On Wed, Jun 8, 2011 at 11:30, Jon Forsyth <jon4s...@gmail.com> wrote:

This part:

> foreach (%word_count){
> print "$word_count{$_}\n\n";
>  }

You want to write like this:

foreach my $key ( keys %word_count ) {
  print "$word_count{$key}\n\n";
}

What you've got above is getting both keys *and* values from the hash,
and you're getting that error when values are used as keys in the
lookup.

chrs,
john.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to