perl -e "sleep 1 and print qq($_ ) for 1..$ARGV[0]" 3 1 2 3 perl -e "$|++; sleep 1 and print qq($_ ) for 1..$ARGV[0]" 3 1 2 3 #### sub my_sleep { # no prototype my $Seconds = shift; print "Sleeping for $Seconds seconds ...\n"; # added newline sleep 1 and print "$_\n" for 1..$Seconds; print "done\n"; }