Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-09-03 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls