#!/usr/bin/perl $FLUSH=1; while (1) { print "$i\n"; if ($FLUSH) { my($oldfh) = select(STDOUT); $| = 1; select($oldfh); } sleep 1; $i++; }