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

Re: Sorting an array of hashes

by admiral_grinder (Pilgrim)
on Mar 26, 2008 at 12:49 UTC ( [id://676386]=note: print w/replies, xml ) Need Help??


in reply to Sorting an array of hashes

Personally, I would simplify this more by removing the dependence on the $i variable. It is fine to have $i in the code for outputting, but if you want to remove it later you can be sure not to introduce bugs:
my $i = 0; foreach my $hash ( @AoH_sorted ) { # Swap these for start with 0 $i++; print "$i\t"; foreach my $key ( keys %{$hash} ) { print "$key\t"; } print "\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 17:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found