in reply to help with counters in perl
It's complaining about 33 & 34, the last two lines in the following code block (if you exclude the close brace):
foreach my $rec (@records) { chomp($rec); ($game, $commercial) = split(/,/, $rec); $game_count{$game} = $game_count{$game} + 1; $comm_count[$commercial] = $comm_count[$commercial] + 1; }
Since I see that you initialized 'Great','Boring', and 'None' in the %game_count hash, and also the first 4 values in the @comm_count array, it must be that it's reading values from your record file that are outside that set of indices. Maybe there are uncapitalized 'great' entries, or perhaps a vote for commercial 10?
What's the file look like? That's the next step.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help with counters in perl
by student in perl/cgi (Initiate) on May 17, 2005 at 11:51 UTC | |
by TheStudent (Scribe) on May 17, 2005 at 12:44 UTC |