- or download this
getopts('oif:', \%opts); # options as above. Values in %opts
- or download this
no strict 'refs';
warn local ${"opt_?"} = 6;
- or download this
use Getopt::Long;
GetOptions( q!help|h|?! => \$help );
- or download this
$ perl -MGetopt::Long -e " my $help; GetOptions( q!help|h|?! => \$help
+ ); warn $help; " -- --help
1 at -e line 1.
...
$ perl -MGetopt::Long -e " my $help; GetOptions( q!help|h|?! => \$help
+ ); warn $help; " -- -f
Unknown option: f
Warning: something's wrong at -e line 1.