Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Sorting an array of hashes

by oko1 (Deacon)
on Mar 26, 2008 at 16:46 UTC ( [id://676455]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    
    my $count = 0;
    print join("\t", $count++, keys %$_), "\n" for sort mysort @AoH;
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    my $count = 0;
    print join("\t", $count++, keys(%{$AoH[$_]})), "\n" for
        sort { keys(%{$AoH[$b]}) <=> keys(%{$AoH[$a]}) } 0 .. $#AoH;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-19 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found