$|++; my $max = 100; for( 1 .. $max ) { print $_, "/$max\r"; sleep 1; }