in reply to Scoping the regex memory variables and where do I go next

What really irks me is that the only way to undefine them (locally) is to do something like:
"jeffrey" =~ /(.*?)(.)\2(.*)/; print "$1 + $2 + $2 + $3 = $1$2$2$3\n"; { local ($1,$2,$3); print "$1 + $2 + $2 + $3 = $1$2$2$3\n"; "" =~ /(?=)/; print "$1 + $2 + $2 + $3 = $1$2$2$3\n"; }
The output is:
je + f + f + rey = jeffrey je + f + f + rey = jeffrey + + + =
Sigh. And you can't do a blanket localization -- that's the worst part; I have to know how many $DIGIT variables are in use, so I know how many to localize. That sucks.

japhy -- Perl and Regex Hacker