OK, here's my amateurish attempt at a correction: #!/usr/local/bin/perl
use warnings; use strict; use diagnostics; use CGI; my $cgi = new CGI; use Mail::Sendmail; use CGI::carp qw(set_die_handler); BEGIN { sub handle_errors { my $msg = shift; sendmail( From => 'i...@theinfosite.com', To => 'jmrhide-theinfos...@yahoo.com', Subject => 'Tutorial Feedback', Message => $msg, ); } set_die_handler(\&handle_errors); } my ( $topic, $score, $lastnum, $answer, $anum, $bnum, $cnum, $dnum, $enum, $smarts, $playlevel, $c_topic, $c_smarts, $c_playlevel, $c_score, $c_lastnum, $c_goodans, $stimulus, $texta, $textb, $textc, $textd, $texte, $defnum, $smiley, $feedback, $goodans, $restart, @data, @cat, @term, @def, @story, @candidate, @termnum, $sound ); my $instructions = "(Click the button next to the best response)"; my $ops = 0; my $loopnum = 1; my $loopmax = 1000; (Skip to "Next Question") if ( $answer or $restart ) { if ( $playlevel < 1 ) { for (my $loopiter <= $loopmax) { #1 if $loopiter >= $loopmax { die "Loop number $loopnum has iterated $loopiter times" } $termnum[0] = int( rand($defnum) ); last unless ( $termnum[0] == $lastnum ); } $loopnum++; Does it look OK? John M Rathbun MD