http://www.perlmonks.org?node_id=95456

xorl has asked for the wisdom of the Perl Monks concerning the following question: (dates and times)

I'm sure this is a dumb question, but I can't seem to find the answer. I have a variable that contains a month name i.e. "October" I want to change that to the number i.e. "10". Is there an easy way of doing this. My only thought was
if ($var eq "January") { $var=1; } elsif ($var eq "Feburary") ...
but this seems rather long and tedious.
Thanks!

Originally posted as a Categorized Question.