Help for this page

Select Code to Download


  1. or download this
    getopts('oif:', \%opts);  # options as above. Values in %opts
    
  2. or download this
    no strict 'refs';
    warn local ${"opt_?"} = 6;
    
  3. or download this
    use Getopt::Long;
    GetOptions( q!help|h|?! => \$help );
    
  4. 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.