Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How do I print the values of a hash, sorted by the hash keys?

by Russ (Deacon)
on Jan 12, 2007 at 19:39 UTC ( [id://594435]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $key ( sort keys %data ) {
        print $data{$key};
    }
    
  2. or download this
    print map { $data{$_} } sort keys %data;
    
  3. or download this
    foreach my $val ( @data{ sort keys %data } ) {
        print $val;
    }
    
  4. or download this
    print @data{ sort keys %data };
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-29 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found