Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Command line options

by mrstlee (Beadle)
on Nov 01, 2011 at 20:34 UTC ( #935211=note: print w/ replies, xml ) Need Help??


in reply to Command line options

I usually do it the other way round:

GetOptions(\%opts, 'opt1=s', 'opt2=i',...); $opts{'opt1'} ||= ($ENV{OPT1} || 'default');
Naturally you would change the assignment above if, for example, 0, was a legal value for opt1, otherwise if the user puts in 0 then either the env var or 'default' will get used.


Comment on Re: Command line options
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2014-09-22 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls