in reply to finding visible length of string?

Another way to do it - just store the visible contents of the string in another variable.

my $unformatted_str = ' coloured! '; my $str = "\033[32m $uf_str \033[m"; $visible_length = length $unformatted_str;