Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: A Simple "Tail" Question

by mlong (Sexton)
on Apr 25, 2001 at 19:11 UTC ( [id://75486]=note: print w/replies, xml ) Need Help??


in reply to A Simple "Tail" Question

You could just create a script that outputs the tail information and then does a refresh of itself. If you don't want to use CGI.pm, Try this:

#!/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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://75486]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-25 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found