in reply to Re: finding visible length of string?
in thread finding visible length of string?

A variation on this would be to just clear the whole line between prints. Something like:

$|++; my $clear = "\r" . ' 'x80 . "\r"; print "quux"; sleep 1; print $clear, "foo"; sleep 1; print "\n";

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: Re: finding visible length of string?
by ajr (Initiate) on Sep 19, 2002 at 01:02 UTC
    I was using "\b" x $i , but I was deleting up to a point which changed as the script progressed, with or without colours in the string (Aaarrgh!). A horrible mess!

    Removing the whole line seems the simplest way.

    <slaps forhead!>

    Thanks, O'holy ones!