Re: Error puzzler
Michael G Schwern <[email protected]> Fri, 15 Sep 2006 16:59:46 -0400
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <[email protected]> |
John Douglas Porter wrote: > Peter Scott <[email protected]> wrote: >> The documentation is clear that <> doesn't >> localize $_. Why not? >> Just so that if someone wanted to get at the last >> value after the loop they could do it without an extra variable? > > With all this talk of local $_, I feel compelled to > point out an insidious problem with the technique; see > http://perlmonks.org/?node_id=561931 I have a solution! DON'T USE $_ [1] The end (until Perl 6) [1] Except in map and grep and the magic while(<>) where its localized.