in reply to Re^6: no chunk is too small
in thread Last undefines a for loop's itererator?
It’s not a special case. All iterator constructs alias their iterator variable: foreach, map and grep all do.
while(<>), which is not an iterator construct in the strict sense, is the sole exception, and we already have to tell people to always local $_; before they while(<>). I’d campaign for it to be brought in line, if it were an option at this time.
Do you really want to have to write
@foo = do { local $_; map bar( $_ ), @baz };
every time you use those constructs, to be safe from accidentally trampling a caller’s $_? I have always considered this piece of magic to DWIM.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: no chunk is too small
by BrowserUk (Patriarch) on Nov 14, 2005 at 01:45 UTC | |
by Aristotle (Chancellor) on Nov 14, 2005 at 02:35 UTC | |
by BrowserUk (Patriarch) on Nov 14, 2005 at 04:44 UTC |