in reply to Printing a hash from a foreach loop

You are iterating over both keys and values of %days_in_month.
To fix, add "keys" in front of %days_in_month
foreach $day (keys %days_in_month) { print "$days_in_month{$day} days hath $day\n"; }
--perlplexer
  • Comment on Re: dumb newbie question about hashes and printing from a foreach loop
  • Download Code