in reply to Sorting Complex Data Scructures
Well, it's all in the sort sub.
The date issue is a little tougher, I recommend turning the date into unix time and sorting numerically. Use the Time::Local module's timelocal command to do the conversion. The exact code will vary depending on your date representation. $time = timelocal( $sec, $min, $hours, $mday, $month, $year) Note that the year representation is like that of time(), so subtract 1900 from the year, eg 2001 = 101.# Sort a list of building ids alpha by name @sorted_ids = sort {$data_struct{$a} cmp $data_struct{$b}} keys(%data_ +struct);
TGI says moo
|
|---|