in reply to Getting Time to work
The month_num hash is pretty cute, but the value of $month is usually meant to be used as an offset into an array. So you would write something like:
$mon = (qw/Jan Feb Mar ... Nov Dec/)[$mon];
In those other cases where you really do need a hash as you have it here, enclose both the hash and the sub that accesses it in curly brackets. That way you reduce the scope of the hash, and it can't be modified (read: trashed) by something else by accident.
|
|---|