in reply to Re: map vs for\foreach.
in thread map vs for\foreach.
"I strictly reserve map for coercion of a set of FOO items into a set of BAR items (@lista -> map -> @listb)..."
And i don't understand why you insist on this.
Just because there must be an example:
#!/usr/bin/env perl use strict; use warnings; use Data::Dump; my @foo = ( 1 .. 10 ); dd \@foo; my @bar = map { ++$_ } @foo; dd \@foo; dd \@bar;
So why is map { ++$_ } @foo; wrong?
I vaguely remember that there where some performance issues...patched?
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: map vs for\foreach.
by MidLifeXis (Monsignor) on Mar 12, 2015 at 12:12 UTC | |
by LanX (Saint) on Mar 13, 2015 at 18:56 UTC | |
by karlgoethebier (Abbot) on Mar 13, 2015 at 18:23 UTC | |
by MidLifeXis (Monsignor) on Mar 13, 2015 at 18:27 UTC | |
by LanX (Saint) on Mar 13, 2015 at 18:44 UTC | |
Re^3: map vs for\foreach.
by Your Mother (Archbishop) on Mar 11, 2015 at 21:48 UTC | |
by ikegami (Patriarch) on Mar 13, 2015 at 17:39 UTC | |
by karlgoethebier (Abbot) on Mar 13, 2015 at 18:31 UTC | |
by LanX (Saint) on Mar 13, 2015 at 18:38 UTC |