levbao has asked for the wisdom of the Perl Monks concerning the following question:
Thank Yousub by_date { my ($monA, $monB, $dayA, $dayB, $yearA, $yearB); ($monA, $dayA, $yearA) = split(/\//, $a); ($monB, $dayB, $yearB) = split(/\//, $b); $yearA <=> $yearB or $monA <=> $monB or $dayA <=> $dayB } foreach $k (sort by_date %H) { ... }
janitored by ybiC: Balanced <code> tags around code example, as per Monastery convention
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorting a hash by its values, date
by ikegami (Patriarch) on Aug 16, 2004 at 23:31 UTC | |
|
Re: sorting a hash by its values, date
by Joost (Canon) on Aug 16, 2004 at 23:34 UTC | |
|
Re: sorting a hash by its values, date
by aquarium (Curate) on Aug 17, 2004 at 03:05 UTC | |
|
Re: sorting a hash by its values, date
by Eimi Metamorphoumai (Deacon) on Aug 16, 2004 at 23:25 UTC | |
by levbao (Initiate) on Aug 16, 2004 at 23:48 UTC | |
|
Re: sorting a hash by its values, date
by Random_Walk (Prior) on Aug 17, 2004 at 08:56 UTC |