Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Think about Loose Coupling
 
PerlMonks  

Re: Range in Getopt

by Discipulus (Deacon)
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
L*
there are no rules, there are no thumbs..


Comment on Re: Range in Getopt
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2014-04-25 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (585 votes), past polls