#!/usr/local/bin/perl -w $|=1; #flush the standard output use strict; sub printMsg { foreach (0.. 10) { sleep(1); print "$_\n"; } } printMsg(); #### end of program