CUFP
itodd
<p>I was experimenting with CGI::Push and came up with a really CUFP. It's tiny, but oh-so-neat and I'm not sure why I haven't stumbled upon this before on the web.</p>
<p>It updates the browser every second. It's too bad IE doesn't conform to standards, I think this (server push) could've led to some neat web services.</p>
<p>You will most likely need to edit it to point to your access_log.</p>
<code>
#!/usr/bin/perl -w
use strict;
use CGI::Push qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use CGI::Carp qw(warningsToBrowser);
do_push(
-type => "text/plain",
-nph => 0,
-delay => 1,
-next_page => sub {
return `uptime`, "\n",
`tail /var/www/logs/access_log`, "\n",
`ps auxw`;
},
);
</code>