#!/usr/bin/perl -Tw # # This is John Chambers' CGI script to take the output of the # saying command and deliver it as a web page. Look for the # Sayings file for the data used by these programs. $| = 1; ($P = $0) =~ s".*/""; $V = $ENV{"V_$P"} || 1; $inHTML = 1; print "Content-type: text/html\n\n"; print "
\n"; print "\n";
$cmd .= " $n";
}
loop:
while ($looping) {
@txt = `$cmd`;
print "Cookie $looping:
\n" if $V>1;
for $line (@txt) {
$line =~ s/[\s\r]+$//;
print "
Line: \"$line\"
\n" if $V>1;
($pfx,$msg) = ($line =~ /^(\|*) ?(.*)$/);
if ($pfx eq '|') { # HTML?
#
} else { # Plain text.
if ($wasHTML) { # We're in a
section print ""; $inHTML = 1; $wasHTML = 0; } elsif ($wasHTML = $inHTML) { print "
";
$inHTML = 0;
}
}
if ($inHTML) {
# $msg =~ s/^\s*//;
$msg = "" unless $msg;
}
print "\t$msg\n";
}
if ($wasHTML) {
print "
";
$inHTML = 1;
$wasHTML = 0;
}
if (--$looping > 0) {
print "\n"; sleep 10; } } print "\n"; exit 0;