I have been reviewing the perlfaq on using the sort function correctly but so far have not been able to get the exact output I need.
I have a hash setup with the dates and times as the keys and the data as the value. I need to sort the dates and times properly. this would normally not be a big issue but the times are in 12 hour format.
here is the format of the hash:Here is the sort:$line_data{"9/10 @ 12:45 PM"} = "some superfluous data here";
This will sort the dates and times but seems to ignore the AM/PM.foreach $key (sort (keys(%line_data))) { print "$key $line_data{$key}\n"; }
The code above does not reflect it but I have tried expanding on the sort with a custom sub called from it. I have not been sucessfull in setting up the right comparison code. More information to follow as I tinker with the sort helper sub.
Any help would be appreciated.In reply to Hash sorting with dates and 12 hour time format. by shift9999
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |