Common and easy mistake.. you're going through each element in your foreach so you're getting both the keys and the values, as if it were an array rather than a hash.
To fix it simply change it to foreach $day (keys %days_in_month. This will only get the keys.
In reply to Re: dumb newbie question about hashes and printing from a foreach loop
by Molt
in thread Printing a hash from a foreach loop
by ceidem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |