in reply to Subroutine for showing the end user the progress of the program
$length = 1; while (doing operation) { for (1..$length){print "\b"} print $numberOfRecords; $length = length($numberOfRecords); }
In other words, for each iteration of your loop, print the number of \b's equal to the string length of your last status message, then print your status message again. That way you get a constantly changing status message on STDOUT, rather than a scrolling '1 records\n','2 records\n' etc
I hope that makes sense!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subroutine for showing the end user the progress of the program
by ghenry (Vicar) on Feb 02, 2005 at 14:47 UTC |