Use of uninitialized value in addition <+> at c05ex1.cgi line 33. Argument "" isn't numeric in array element at c05ex1.cgi line 34. #### #!/usr/bin/perl #c05ex1.cgi - saves form data to a file, and creates a dynamic #Web page that displays a message and survey statistics print "Content-type: text/html\n\n"; use CGI qw(:standard -debug); use strict; #declare variables my ($game, $commercial, @records); my %game_count = ("Great", 0, "Boring", 0, "None", 0); my @comm_count = (0, 0, 0, 0); #assign input items to variables $game = param('Game'); $commercial = param('Commercial'); #save form data to a file open(OUTFILE, ">>", "c05ex1.txt") or die "Error opening c05ex1.txt. $!, stopped"; print OUTFILE "$game,$commercial\n"; close(OUTFILE); #calculate survey statistics open(INFILE, "<", "c05ex1.txt") or die "Error opening c05ex1.txt. $!, stopped"; @records = ; close(INFILE); foreach my $rec (@records) { chomp($rec); ($game, $commercial) = split(/,/, $rec); $game_count{$game} = $game_count{$game} + 1; $comm_count[$commercial] = $comm_count[$commercial] + 1; } #generate HTML acknowledgment print "WKRK-TV\n"; print "\n"; print "

Thank you for participating in our survey.

\n"; print "What did you think of the Super Bowl game?\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
It was a great game. $game_count{Great}
It was a boring game. $game_count{Boring}
I didn't watch the game.$game_count{None}

\n"; print "Vote for your favorite Super Bowl commercial:\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n";
Budweiser $comm_count[0]
FedEX $comm_count[1]
MasterCard $comm_count[2]
Pepsi $comm_count[3]