print " progress: \n"; foreach my $query (@queries) { $count2++; my $xx = ($count2/$count)*100; $xx = sprintf "%.0f", $xx; if ($xx % 10 == 0) { if ($xx != $laststatus) { print " * $xx\n"; # removing the \n here will stop printing:( $laststatus=$xx; } } }