while( @to_do ) { # do something with next value of @to_do list... shift @todo; ... # report progress without causing the terminal to scroll: printf( " ... still %4d more to go\r", scalar @to_do ); }