Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Elsewhere i need to get a reversed hash of the previous, a month abbreviation according to his number. i tried :# correspondance map between a month name and his number use constant MONTH => { jan => 1, feb => 2, mar => 3, apr => 4, may => 5, jun => 6, jui => 7, aug => 8, sep => 9, oct => 10, nov => 11, dec => 12 };
which is i'm afraid not correct. Any idea to solve that ?my %reverse_month = reverse %{[ MONTH ]} # WRONG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: get a reverse of a constant hash
by Corion (Patriarch) on Jun 11, 2004 at 07:47 UTC | |
|
Re: get a reverse of a constant hash
by borisz (Canon) on Jun 11, 2004 at 07:42 UTC | |
|
Re: get a reverse of a constant hash
by Joost (Canon) on Jun 11, 2004 at 09:36 UTC | |
|
Re: get a reverse of a constant hash
by Anonymous Monk on Jun 11, 2004 at 11:32 UTC |