Steve Bertrand wrote:
> John W. Krahn wrote:
>> perldoc perlsyn
>> [ SNIP ]
>> NOTE: The behaviour of a "my" statement modified with a statement
>> modifier conditional or loop construct (e.g. "my $x if ...") is
>> undefined. The value of the "my" variable may be "undef", any
>> previously assigned value, or possibly anything else. Don’t rely on
>> it. Future versions of perl might do something different from the
>> version of perl you try it out on. Here be dragons.
>>
>>> if ( $month !~ m{ \A \d{4}-\d{2} \z }xms ) {
>>> print "\nInvalid date parameter. Must be supplied as 'YYYY-MM'\n\n";
>>> exit;
>> You exit the program if $month is not equal to a seven character string.
Nevermind. I see what you were saying. Technically, I've never tried to
get past the regex check with this script (that I can remember)...
I completely understand why you said what you did after I reviewed the
logic again.
Ahh well, I'd rather be vocal and get good feedback to later review than
say nothing and never learn!
Thanks all, because of a simple `perlcritic` warning, I've learnt a
tremendous amount!
Steve
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/