Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by kwaping (Priest)
on Jul 21, 2006 at 19:51 UTC ( [id://562930]=note: print w/replies, xml ) Need Help??


in reply to How do I print the values of a hash, sorted by the hash keys?

You can also do this:
foreach my $key (sort keys %data) { print $data{$key} . $/; }
However, my first answer works well with a join():
print join('|', @data{sort keys %data});

Originally posted as a Categorized Answer.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://562930]
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: (6)
As of 2024-04-23 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found