|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Options with optional values and condititionsby kennethk (Monsignor) |
| on Oct 02, 2012 at 16:14 UTC ( #996879=note: print w/ replies, xml ) | Need Help?? |
|
I think the logic you mean is:
I used the length test because 0 is a potentially valid input but evaluates to false in logical context. This would also hold for a whitespace-only input, e.g.: perl script.pl --foo=' ' #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||