- or download this
Jul11 = 1107
Jun11 = 1106
Aug13 = 1308
May14 = 1405
etc...
- or download this
sub sortKeys {
my ( $l_mo, $l_yr ) = $a =~ /(\D+)(\d+)/;
...
my $right = $r_yr . $months->{$r_mo};
return ( $left cmp $right );
}
- or download this
sub sortKeys {
( my $left = $a ) =~ s/(\D+)(\d+)/$2 . $months->{$1}/e;
( my $right = $b ) =~ s/(\D+)(\d+)/$2 . $months->{$1}/e;
return ( $left cmp $right );
}
- or download this
#!/usr/bin/perl
...
Key - May14 and b value - 2