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

Re: "Getoptions'" argument syntax

by btrott (Parson)
on Jun 16, 2001 at 00:15 UTC ( #88928=note: print w/replies, xml ) Need Help??


in reply to "Getoptions'" argument syntax

The '=' in 'refresh=i' doesn't mean that 'refresh' is a mandatory option to the program. It means that, if 'refresh' is supplied, the *integer argument* is mandatory. So you can't just have
$ foo.pl --refresh
An argument to 'refresh' is mandatory.

I don't think there *is* a way to indicate that an option is mandatory (ie. that 'refresh' must be provided as an option).

And since 'refresh' may not be provided, the

$REFRESH = 10
sets the default value for 'refresh' to 10. And it can be overriden on the command line with '--refresh'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://88928]
help
Chatterbox?
[1nickt]: jdporter Maybe try IPC::Run3
[LanX]: Sandy Koufax is indeed rude. .. oO
[chacham]: Re: Re: pattern matching -- feeling stoopit a poll idea about centrists, is +8 -5, used to be +6/-6 how apropos :)is +8
[chacham]: ...errr... Re: poll ideas quest 2015 (political centrist)
[chacham]: ooh, late, nighty nite everybody

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2017-05-24 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?