{ use constant DEFAULT_STEP => 100; # a DOT is printed every DEFAULT_STEP call use constant LINE => 50; # nb of DOT per line use constant BLOCK => 10; # a SPACE is printed after BLOCK DOTs use constant DOT => '.'; # probably no need to change this use constant SPACE => ' '; # probably no need to change this my( $i, $j); sub progress { my $step= shift || DEFAULT_STEP; $i++; if( $i == $step) { $i=0; print STDOUT DOT; $j++; unless( $j % BLOCK) { print STDOUT SPACE; if( $j == LINE) { $j=0; print STDOUT "\n"; } } } } }