Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: map vs for\foreach.

by sn1987a (Chaplain)
on Mar 11, 2015 at 15:12 UTC ( #1119654=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
            'map (bare)'   => sub { map { $_ += 1 } @a; },
        }
    );
    
  2. or download this
                 s/iter map (assign)   map (bare)      foreach
    map (assign)   2.06           --         -40%         -76%
    map (bare)     1.23          67%           --         -59%
    foreach       0.501         311%         146%           --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1119654]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2019-07-18 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?