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;