Keep It Simple, Stupid | |
PerlMonks |
Re: Modifying value of $1 clobbers $2, $3 etc?by robartes (Priest) |
on Oct 12, 2003 at 10:55 UTC ( [id://298628]=note: print w/replies, xml ) | Need Help?? |
You give the answer yourself:
The scope of $<digit> extends to the end of the enclosing BLOCK or eval string, or to the next successful pattern match, whichever comes first.Line 7 of your script is a successful pattern match (a substitution is also a pattern match), so the $<digit> vars go out of scope Update: removed inaccurate or even plain wrong stuff. CU
In Section
Seekers of Perl Wisdom
|
|