in reply to A Simple "Tail" Question
#!/usr/bin/perl print "Content-type: text/html\n\n"; # Do tail stuff here my $tail = ... # Replace carriage returns with br and carriage return $tail =~ s/\n/<br>\n/g; # print it out print <<END_HTML <html> <head> <title>Tail Script</title> <META HTTP-EQUIV="REFRESH" CONTENT="2; URL=/cgi-bin/cgiscript.cgi"> </head> <body> <h1>Tail Program</h1> <P> $tail </body> END_HTML
Where "cgiscript.cgi" is the name of this script. (You might be able to use $0, but I haven't tried that in a CGI).
Then the browser will refresh to your current CGI every 2 seconds or whatever interval you set in the meta tag.
It's a hack, but it should work.
-Matt
|
|---|