$x = $y = "apple"; "orange" =~ /(.*)(?{$x = $^N; local $y = $^N})/; print "$x\n$y\n"; __END__ orange apple
If all variables would be automatically localized, it would be hard to pass any information from the regex back to the program.
I can't find something in the documentation that suggests variables are automatically localized.
Abigail
In reply to Re: Code in regexp
by Abigail-II
in thread Code in regexp
by gjb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |