#!/usr/bin/perl $| = 1; # as flushy as possible open(STDERR, ">&STDOUT"); use warnings; use IPC::Open2; print( "Content-type: text/plain\nTransfer-encoding: chunked\n\n"); unless( open2( OUT, IN, ( '/usr/bin/tail', '-F', '-n', '100', '/var/log/syslog' ) ) ) { die 'could not execute tail'; }; select( (select(OUT), $| = 1)[0] ); # see if we can force rendering with disgusting amounts of padding #my $padding = "\0" x 4096; while( ) { # printf( "%x\r\n%s\r\n", length( $padding ), $padding ); printf( "%x\r\n%s\r\n", length( $_ ), $_ ); };