use strict; use warnings; print "going to sleep\n"; my $i = 0; while ($i<20){ sleep (1); print "zzz\n"; $i++; } print "finished my beauty sleep\n";