> ./crop.pl Global symbol "$response1" requires explicit package name at ./crop.pl line 41. Global symbol "$response1" requires explicit package name at ./crop.pl line 48. Execution of ./crop.pl aborted due to compilation errors. #### #!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; use CGI qw(:standard); my $cornplanted=0; my $cornnotplanted=0; #@number1=("12" .. "25"); #$number1rand=$number1[rand @number1]; my $number1rand=int(rand(20)); my $number2=int(rand(12)); my $correctanswer=($number1rand + $number2); print "$correctanswer
"; my $output=<<_html_;
Crops planted: $cornplanted
Crops not planted: $cornnotplanted
What does this math problem equal?
$number1rand + $number2 =
_html_ print $output; if ($response1 eq "$correctanswer") { $cornplanted=($cornplanted + 1); print "correct!"; } elsif ($response1 ne "$correctanswer") { $cornnotplanted=($cornnotplanted + 1); print "not correct!"; }