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: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.my @sorted = sort { timecompare($a->{runs}, $b->{runs}) } @job_data;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting an array of hashes
by Scarborough (Hermit) on Jul 28, 2004 at 09:04 UTC |