Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Sorting an array of hashes

by admiral_grinder (Pilgrim)
on Mar 26, 2008 at 12:49 UTC ( #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
Node Status?
node history
Node Type: note [id://676386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-08-13 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (75 votes). Check out past polls.

    Notices?