![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re: Trying to understand subtleties of Getopt::Long, please helpby Sidhekin (Priest) |
on Sep 23, 2007 at 22:22 UTC ( #640619=note: print w/replies, xml ) | Need Help?? |
What is "mandatory" and "optional" is not the option itself (options are by their nature always optional) but rather the associated argument. That is, --option without an argument will be an error on option=s or option=i, but will give the empty string on option:s and zero on option:i. (A missing --option or an option with argument (--option=42) will be treated the same by both.) Try @ARGV = qw( --tag ); with your cases 5 and 6, and you'll see the behaviour you expected.
print "Just another Perl ${\(trickster and hacker)},"
In Section
Seekers of Perl Wisdom
|
|