![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( #3333=superdoc: 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 reply to Re: Trying to understand subtleties of Getopt::Long, please help
by Sidhekin
|
|