in reply to Changing array by changing $_?
This is a feature. It's designed this way.
If you don't want to modify the original element, make a copy first. For instance:
foreach (@array) { local $_ = $_; # Change 'local' to 'my' in 5.10. ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Changing array by changing $_?
by johnvandam (Acolyte) on Oct 13, 2008 at 12:17 UTC | |
by gone2015 (Deacon) on Oct 13, 2008 at 12:41 UTC | |
by ikegami (Patriarch) on Oct 13, 2008 at 14:01 UTC | |
by GrandFather (Saint) on Oct 13, 2008 at 20:36 UTC | |
by busunsl (Vicar) on Oct 13, 2008 at 12:42 UTC |