That can be written far more simply and efficiently as:my $pad = ' ' x $wide; ... $_ = substr($_ . $pad, 0, $wide); print $_, "\r";
printf "%-${wide}.${wide}s\r", $_;
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re: peek - output a one-line preview of stdin
by merlyn
in thread peek - output a one-line preview of stdin
by halley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |