use Getopt::Long; Getopt::Long::Configure('bundling'); my %options; GetOptions( \%options, 'LongName|L=s' ); if ($options{LongName}) { # do something with $options{LongName} } #### prog.pl --longname something #### prog.pl -L something
## prog.pl --longname something ##
## prog.pl -L something