#!/usr/bin/perl -w use strict; use CGI qw/:standard :push -nph/; my $q=CGI->new; $| = 1; open FH,"; } print $q->header(-type=>'text/event-stream',-charset=>"utf-8"); $SIG{'PIPE'}=sub { close FH; exit 0; }; while (1) { printf "event: ut\ndata:%s\n\n", readprocuptime; select undef,undef,undef,1; };