Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: A regex BR variable dead in following line/commandby roboticus (Chancellor) |
on Nov 12, 2021 at 13:49 UTC ( [id://11138757]=note: print w/replies, xml ) | Need Help?? |
If you want to keep it, then store it in a variable:
The capture group variables are set every time you do a match. Can you imagine how annoying it would be if they weren't? Then you'd have to explicitly clear them before doing a match or you'd risk getting bits of old data mixed in with new data. The current automatic clearing of the group variables is a much better match to typical expected behavior. ...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom
|
|