in reply to Sorting an array of hashes

I assume that within the anonymous hash you meant to write "=>" instead of "=".

You're looking at doing something like:
my @sorted = sort { timecompare($a->{runs}, $b->{runs}) } @job_data;
where timecompare is a routine you'll need to supply (i.e., "left as an exercise") that takes two strings of the form '19:20', does whatever manipulations is necessary to compare them, and returns -1, 0, or 1. Since you don't show whether a shorter time is shown as "03:01" vs. "3:01", a straight cmp may or may not work for you.

Replies are listed 'Best First'.
Re^2: Sorting an array of hashes
by Scarborough (Hermit) on Jul 28, 2004 at 09:04 UTC
    Your dead right here and in essence this is what I've been trying, but had completely the wrong idea about how the values got to the sub routine. The other fist 2 answers are fine but only deal with string order. Thanks for your help!!