Don't rely on the values of $1 et al. if you don't know that the regex matched.
Here's a very simple example:
/(a)/; print "matched $1\n"; # WRONG! if (/(a)/) { print "matched $1\n"; # Right }
In reply to Re: Scoping the regex memory variables and where do I go next
by chipmunk
in thread Scoping the regex memory variables and where do I go next
by Rudif
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |