in reply to help with counters in perl

Are you sure you are getting the input you think you are? You could probably find out what is wrong with a couple of simple print statements. How about:
foreach my $rec (@records) { chomp($rec); ($game, $commercial) = split(/,/, $rec); print "\$game: >$game<\n\$commercial: >$commercial<\n"; # <<<< + debug $game_count{$game} = $game_count{$game} + 1; $comm_count[$commercial] = $comm_count[$commercial] + 1; }

Replies are listed 'Best First'.
Re^2: help with counters in perl
by Fletch (Bishop) on May 17, 2005 at 00:09 UTC

    While it's a good idea to use some sort of delimiter around variables in debug output, < and > probably aren't the best first choices for a CGI context . . .