![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Strange Regex Behaviorby quester (Vicar) |
on Dec 06, 2011 at 06:34 UTC ( [id://941963]=note: print w/replies, xml ) | Need Help?? |
It might be a little more obvious like this:
which prints
So, it did the second pattern match first, and interpreted $1 to be the result of that pattern match. It's the same sort of ambiguity that is found in, say, ($i++)+$i.
In Section
Seekers of Perl Wisdom
|
|