in reply to finding visible length of string?

There was a previous thread on clearing a line here (Super Search is always your friend :-)) see my node for an approach using tput (works on *nix boxes). Depending on what else you are doing in your code but Curses or Curses:UI may also be worth looking at.

--
Until you've lost your reputation, you never realize what a burden it was or what freedom really is. -Margaret Mitchell