in reply to Attempting to fill a hash
to:while (<$wordhandle>) { $deadstring = chomp; $hashlist{$deadstring} => 1; $wordcount++; }
You had two small errors...while (<$wordhandle>) { chomp; $hashlist{$_} = 1; $wordcount++; }
1. chomp returns the number of characters chomped, so $deadstring = chomp assigns a number to $deadstring.
2. You're using the fat comma => instead of the assignment operator = in $hashlist{$deadstring} => 1;.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Attempting to fill a hash
by TwistedTransistor (Novice) on Jun 06, 2008 at 00:43 UTC | |
by pc88mxer (Vicar) on Jun 06, 2008 at 00:54 UTC | |
by TwistedTransistor (Novice) on Jun 06, 2008 at 01:09 UTC | |
by toolic (Bishop) on Jun 06, 2008 at 01:31 UTC | |
by pc88mxer (Vicar) on Jun 06, 2008 at 01:36 UTC | |
by almut (Canon) on Jun 06, 2008 at 01:49 UTC | |
by parv (Parson) on Jun 06, 2008 at 03:10 UTC | |
by TwistedTransistor (Novice) on Jun 06, 2008 at 01:44 UTC |