Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Sorting an array or hashes

by hok_si_la (Curate)
on Jan 24, 2012 at 18:02 UTC ( [id://949738]=note: print w/replies, xml ) Need Help??


in reply to Re: Sorting an array or hashes
in thread Sorting an array or hashes

Thanks for the help Corion. I cleaned up my code a bit and used the following to print sorted elements of my AoH (@collectionData):
foreach $j (@sortedCollectionData) { my ($longStatus, $rowStyle, $rowColor); $longStatus = $translateLongStatus{ $collectionData[$j]->{Status} +} ||'Submitted Complete'; if (($i%2) == 0){ $rowStyle = "oddrow"; $rowColor = "#e5e5e5"; } else { $rowStyle = "evenrow"; $rowColor = "#ffffff"; } print qq{ <tr class=$rowStyle style=Cursor:hand onclick= \"location.href=\'get +Collection.pl?id=$collectionData[$j]->{CollectionId}\';\" onMouseOver +=\"style.backgroundColor='#c5c5c5'\" onMouseOut=\"style.backgroundCol +or='$rowColor'\"> <th class=graycenter>$collectionData[$j]->{'CollectionId'}</th> <th class=graycenter>$collectionData[$j]->{'Framecount'}</th> <th class=graycenter>$collectionData[$j]->{'Missing'}</th> <th class=graycenter>$longStatus</th> <th class=graycenter>$collectionData[$j]->{'Modified'}</th> </tr> };

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-25 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found