Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How to find what options are used for Getopt::Long

by toolic (Chancellor)
on Aug 03, 2012 at 12:17 UTC ( #985223=note: print w/ replies, xml ) Need Help??


in reply to How to find what options are used for Getopt::Long

Another way is to store all your opt in a hash instead of individual scalars:

use warnings; use strict; use Getopt::Long; use Data::Dumper; $Data::Dumper::Sortkeys=1; my %opt; GetOptions(\%opt, qw( help cfg=s verbose silent dir=s )) or die "Mandatory options not supplied\n"; print Dumper(\%opt); __END__ script.pl -h -v $VAR1 = { 'help' => 1, 'verbose' => 1 };


Comment on Re: How to find what options are used for Getopt::Long
Download Code
Re^2: How to find what options are used for Getopt::Long
by doubledecker (Scribe) on Aug 07, 2012 at 11:02 UTC

    Works for me

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985223]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-10-23 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (123 votes), past polls