Listing 5. /home/httpd/cgi-bin/dialdstate.pl

#!/usr/bin/perl -Tw
# written on Sunday, 8 August 1999
# by Edward J. Beroset
my $STATFILE = "/tmp/diald.status";
$ENV{PATH} = "/bin:/usr/bin";
print <<"END";
Content-Type: text/html
<html> <head>
<title>Internet Connection Status</title> </head>
<body> <h2>Internet Connection Status</h2> <pre>
<SCRIPT LANGUAGE="JavaScript">
setTimeout("location.reload()", 7000);
END
open(STATFILE, "< $STATFILE") or die
   "Can't open file $STATFILE: $!";
while (<STATFILE>) {
   chop;
   print "document.writeln(\"$_\");\n";
}
close STATFILE;
print "</SCRIPT> </pre> </body></html>";