![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Re: perl regular expressions and empty strings unexpected resultsby moritz (Cardinal) |
on Jan 23, 2012 at 09:44 UTC ( #949345=note: print w/replies, xml ) | Need Help?? |
and has very loose precedence, so your last example is parsed as
The first regex match succeeds (thus the 1), and the result of the second one is discarded. Use && instead of and to get the result you want. See also: perlop.
In Section
Seekers of Perl Wisdom
|
|