Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 avoiding work at the Monastery: (9)
As of 2014-11-24 12:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (141 votes), past polls