Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by BrowserUk (Patriarch)
on Oct 04, 2012 at 22:49 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://997339]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-23 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found