Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Range in Getopt

by Discipulus (Vicar)
on Oct 03, 2012 at 07:53 UTC ( #996998=note: print w/ replies, xml ) Need Help??

in reply to Range in Getopt

i usually do like this:

my $needed_param = 'need_default'; my $debug = 0; # default value numeric and not "" # getting params with getopt with a strict syntax # id est: if GetOptions fail may be better the program does NOT run at + all &help()if( ! GetOptions( 'needed=s' => \$needed_param, # [..] 'd=i' => \$_debug ) or ! $needed_param ); #then adjust values to a default or a maximum as needed $debug > 3 ? $debug = 3 : $debug ; sub help { "$0 -n [-d [0-3]] ... "}
hope this help
there are no rules, there are no thumbs..

Comment on Re: Range in Getopt
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2015-11-28 14:10 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (742 votes), past polls