#!/usr/bin/perl use strict; use warnings; use Getopt::Std; use Data::Dumper; my %opts; getopts('hif:', \%opts) || usage(); usage() if(exists($opts{h})); print Dumper(\%opts); sub usage { print "USAGE: $0 -h -i -f \n"; exit; }