FAQ
On Wed, Jun 8, 2011 at 11:30, Jon Forsyth 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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupbeginners @
categoriesperl
postedJun 8, '11 at 3:30p
activeJun 8, '11 at 4:41p
posts3
users3
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase