Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Efficiency of map vs. more verbose basic/fundamental code

by marquezc329 (Scribe)
on Oct 04, 2012 at 20:52 UTC ( #997326=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach $key (sort keys %h) { 
       print "$key: $h{$key}\n"; 
    }
    
  2. or download this
    print map "$_: $h{$_}\n", sort keys %h;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://997326]
Approved by marto
Front-paged by ELISHEVA
help
Chatterbox?
[Corion]: I'm happy I'm not the only one who got a The Thing vibe from The Hateful Eight

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2016-12-09 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (155 votes). Check out past polls.