in reply to Getting numeric month for comparisons
$month_names{'English abbr'} = [ map substr($_, 0, 3), @{ $month_names{English} } ];
Also note that this solution is not universal. It breaks when you add for example Czech and Croatian:
Croatian => [qw[ Siječanj Veljača Ožujak Travanj Svibanj Lipanj Srpanj Kolovoz Rujan Listopad Studeni Prosinac ]],
Czech => [qw[ leden únor březen duben květen červen červenec srpen září říjen listopad prosinec ]],
# ...
say get_month_number('listopad'); # 10 or 11?
Update: Fixed encoding.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting numeric month for comparisons
by Lady_Aleena (Priest) on Mar 06, 2016 at 13:30 UTC |