#!/usr/bin/perl -w $|=1; { print "Content-type: text/plain\n\n"; print "Autoflush is currently " . ($|?"on":"off") . ".\n"; for ( 1..5 ) { print "Value is $_.\n"; sleep 1; } print "Autoflush is currently " . ($|?"on":"off") . ".\n"; }