in reply to RE prollem: \G, \\? and disappearing data
Okay, well thanks to MeowChow's comment that confirmed for me that this is a bug in perl (blech), I went looking for, and found, a work-around.
The following code works the way it should:
$_ = 'foo\$bar'; { if(m/\G((?:\\\$|\$)\w+)/gc or m/\G(\w+)/gc) { print "token: '$1'\n"; redo; } }
And produces the following output:
token: 'foo' token: '\$bar'
And it also works correctly on $_ = 'foo$bar'; giving:
token: 'foo' token: '$bar'
Thanks, MeowChow, for your help!
I'm still interested if someone can tell me exactly how this bug is working (or not working, depending on your POV) and why it is. Thanks, everyone!
bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.
|
|---|