in reply to Delving the regexp underdark -- how to understand \G's behavior, or how to loop through a regular expression

Watching pos() in the debugger and trying different things from the command line can help.

I found this out last night. Turns out I couldn't get pos for $_, when I assigned it to a local variable, it worked fine. (This is in 5.05.003 and I was using it in recursive anonymous subs, so it may not be a general problem.)


p