in reply to Re: sorting keys in hash
in thread sorting keys in hash
my %mthSO = do { my $order; map { $_, ++ $order } qw{ ... }; };
...
$mthSO{ $a->[ 1 ] } cmp $mthSO{ $b->[ 1 ] }
Since month names are map-ped to numeric values, shouldn't the month name value comparison be numeric <=> rather than lexicographic? Adding the dates Jan14 Dec14 to the test set shows the problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: sorting keys in hash
by johngg (Canon) on May 24, 2014 at 15:17 UTC |