I'm not positive, but I believe you'll need a cpan module like Curses
Of course the easiest method is just to combine your dynamic text to a single line so that you can stick to just using \r
my @dirs = map {chomp; $_} <DATA>; my $i = 0; my $lastlen = 0; local $| = 1; for my $dir (@dirs) { $i++; my $output = "<-- " . int($i / @dirs * 100) . " ($i/" . @dirs . ") + complete, $dir -->"; substr($output, 60) = '' if length $output > 60; # Truncate print "\r$output"; # Cover longer lines my $len = length $output; print ' ' x ($lastlen - $len) if $lastlen > $len; $lastlen = $len; sleep 1; } __DATA__ /etc/hosts /foo/bar /boo/bazinga /baz /foo/bin /foo/bin2 /foo/bin3 /foo/bin4 /foo/z /zar
In reply to Re: Multi-line Status while script is running
by wind
in thread Multi-line Status while script is running
by lavermil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |