in reply to peek - output a one-line preview of stdin
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 Section
Code Catacombs