One of the problems with using STDIN to pause a program is that input is often buffered. Thus you may actually be getting data that was previously entered when you are attempting to pause. You can test this by adding this change to your program:
if ($course eq "ERROR") {
print "Fatal Error - see errorLog.txt for details \n" ;
print "Hit 'ENTER' to quit\n" ;
my $temp = <> ;
warn "\n**$temp**\n";#show what was read from STDIN
sleep 5;#give yourself time to see it
}
If the Win32 package is available and a popup is permissable, try the Win32::MsgBox() function mentioned above as an alternative. It is a better solution to this problem.