$| = 1; # output autoflush for ( 1 .. $x ) { push @array, $_; print "I did '$x'! Yay!\n"; }