use strict; use Getopt::Std; our ($opt_h, $opt_a); getopt('ha'); print "help=$opt_h\n" if (defined $opt_h); print "all=$opt_a\n" if (defined $opt_a); #### perl -w test.pl -h -a help=-a #### perl -w test.pl -h -a help=1 all=1
## perl -w test.pl -h -a help=-a ##
## perl -w test.pl -h -a help=1 all=1