Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Efficiency of map vs. more verbose basic/fundamental code

by BrowserUk (Pope)
on Oct 04, 2012 at 22:49 UTC ( #997339=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print <1e6 key/value/newline> map "$_: $h{$_}\n", <1e6 ordered keys> s
    +ort <1e6 unordered keys>;
    
  2. or download this
    foreach $key ( <1e6 sorted items> sort <1e6 unordered items> keys %h) 
    +{ 
        print "$key: $h{$key}\n"; 
    }
    
  3. or download this
    print "$_ : $h{ $_ }\n" for sort keys %h;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-12-29 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls