sorting hash

Posted on 2001-08-11
Last Modified: 2010-03-05
I have a hash like this:


I have to sort it by value.


Then I have to print the keys.
Question by:superquestions
  • 2

Expert Comment

by:christopher sagayam
ID: 6376199
foreach $key(sort {$allurls{$a} <=> $allurls{$b}} keys %links)


Accepted Solution

christopher sagayam earned 50 total points
ID: 6376200
oops it should be

foreach $key(sort {$links{$a} <=> $links{$b}} keys %links)


Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl script to parse log and delete the file 17 173
Reading fields from the text file. 4 97
collecting information 2 158
Perl: How to add backslashes to every period in a string 1 22
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In a recent question ( here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question