|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^2: Searchin' through valuesby vitoco (Pilgrim) |
| on Dec 14, 2009 at 13:08 UTC ( #812704=note: print w/ replies, xml ) | Need Help?? |
|
I found very interesting this piece of code as an example for the \G pattern, but I noticed that x modifier was missing on each regexp AFAIK, but then tested if there was anything else I'm not awared. Just as it is, it returns nothing on $pat. Then added the x modifier and got an endless loop! I thought it was related to a note in perlre: "It is worth noting that \G improperly used can result in an infinite loop.", but a small trace using print "($pat)\n"; just before each redo shows that \G is always at the beginning of the argument, not after what was already matched. I tried again removing pos() to see if that function resets the pointer... No luck! Am I doing something wrong?
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||