Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Wisdom on the Getopt::Long module

by abhijithtk (Novice)
on Jul 14, 2010 at 18:11 UTC ( [id://849595]=perlquestion: print w/replies, xml ) Need Help??

abhijithtk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Wisdom on the Getopt::Long module
by toolic (Bishop) on Jul 14, 2010 at 18:17 UTC
    I think this satisfies your requirements:
    GetOptions('x:s'=>\$x); $x = 0 unless $x;

    On a side note, please do not enclose your whole posting inside "pre" tags. You should post only your code inside "code" tags. Refer to Writeup Formatting Tips.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Wisdom on the Getopt::Long module
by JavaFan (Canon) on Jul 14, 2010 at 22:16 UTC
    GetOptions("x:s"=>\$x); $x ||= defined $x;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://849595]
Approved by ahmad
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-26 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found