Perl month hash

I'm really tired of retyping this:

my $mons = {
    'Jan' => 1,
    'Feb' => 2,
    'Mar' => 3,
    'Apr' => 4,
    'May' => 5,
    'Jun' => 6,
    'Jul' => 7,
    'Aug' => 8,
    'Sep' => 9,
    'Oct' => 10,
    'Nov' => 11,
    'Dec' => 12,
};

Then access it with $mons->{Jul} to get the number. Or you can flip it to get a mapping of numbers to months:

$rev = { reverse(%$mons) };


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 18.117.103.185
To prevent spam please submit by clicking the kitten: