Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Sort hash keys

by GrandFather (Saint)
on Sep 17, 2010 at 10:04 UTC ( [id://860460]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %seq = ('1035-2341', '1', '1035-2347', '1', '1035-65', '1', '1035-4
    +6', '1');
    
    foreach (sort {length $a <=> length $b || $a cmp $b} keys %seq) {
        print $_, "\n";
    }
    
  2. or download this
    1035-46
    1035-65
    1035-2341
    1035-2347
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found