in reply to Getting numeric month for comparisons

As the English abbreviations are regular, it might be easier to define them as
$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

    choroba, while substr might appear easier, it is not shorter. Also, I don't use substr enough to remember it is in the toolbox.

    As for the Croatian and Czech month name position problem and if I were to have to choose between them, I would choose to add Czech since it has almost twice the amount of speakers then Croatian. I can't think of an easy way to fix the problem. I could add something where the user is given the option to add problematic languages if needed.

    get_month_number('listopad', {'Czech or Croatian' => 'Czech'});

    Other than that, I'm not sure.

    No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
    Lady Aleena