http://qs321.pair.com?node_id=858335

rir has asked for the wisdom of the Perl Monks concerning the following question:

Update: I'd downvote this if I could. My error was thinking $a and $b when $_ was appropriate.

The recent thread, Better algorithm or data structure?, shows that this behavior of $_ is not well known. It surprised me. It took prompting for this aspect to register (thanks, BrowserUk).

Update: reduced code to the point. This expresses that to which I was referring. Map and grep, like for can, localize $_; this makes this post nonsensical;

## perl 5.10.1 use strict; use warnings; my $oo; my @ary = ( 0, 1, 2, 3); grep $ary[$_ ], @ary; # no warning grep $ary[$oo], @ary; # warns
Be well,
rir

Original verbose code: