#Put the following code at the top of the script, just below #!/usr/bin/perl. #Run the program from your browser, and read what is printed there. BEGIN { local($|) = 1; # Temporarily turn off buffering print "Content-type: text/plain\n\n"; my $date = localtime; print "Script $0\nrunning on $date (Perl version $])\n\n"; unless (open STDERR, ">&STDOUT") { print "Can't redirect STDERR: $!"; exit; } print "\n"; }