#!/usr/bin/perl -w $|=1; use CGI qw/:standard/; { my $cgi = CGI->new; print $cgi->header('text/plain'); print "Autoflush is currently ".($|?"on":"off").".\n"; for ( 1..5 ) { print "Value is $_.\n"; sleep 1; } print "Autoflush is currently ".($|?"on":"off").".\n"; }