No such thing as a small change | |
PerlMonks |
Re: regex with multiple matches, missing first match?by agentv (Friar) |
on Apr 22, 2003 at 12:35 UTC ( [id://252250]=note: print w/replies, xml ) | Need Help?? |
...this is just a guess, but I believe that whether you quote the assignment string or not makes all the difference in the world. (Although in my tests, the interpreter choked unless I supplied quotes.)
But presuming that quotes are not necessary in some contexts, here is what could happen. The OR operator, "|" has a higher precedence than the assignment, so the fragment "1 | 0.116" yields "1". That would account for the anomaly that you describe. On the other hand again, I could not get your assignment instruction to run under 5.6 using the debugger interactively. So I have to reiterate the wonder about there being any output at all from your program.
...All the world looks like -well- all the world,
when your hammer is Perl.
In Section
Seekers of Perl Wisdom
|
|