in reply to Re^4: filtering an array
in thread filtering an array
Likewise, the for is unnecessary in this code too:
for (@positions) {@positions = map $_->[0], @positions;}
It should just be:
@positions = map $_->[0], @positions;
because map iterates over the array you give it. Even better, you could write:
$_ = $_->[0] for @positions;
here we are making the for implicit in map explicit.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: filtering an array
by prbndr (Acolyte) on Sep 01, 2012 at 23:15 UTC | |
by philiprbrenan (Monk) on Sep 01, 2012 at 23:19 UTC | |
by prbndr (Acolyte) on Sep 01, 2012 at 23:39 UTC |