No such thing as a small change | |
PerlMonks |
Re: Re: Re: Inserting a little life to my outputby dempa (Friar) |
on Dec 17, 2002 at 15:04 UTC ( [id://220537]=note: print w/replies, xml ) | Need Help?? |
Sure hotshot (if I remember what I did, that is :) ). When I made this subroutine and used the output for a colorful prompt (with Term::ReadLine), the color codes (the real ones, from Term::ANSIColor) confused the readline-prompt. In short, it counted the "invisible" color codes as characters and inserted the newline (which should come at the end of the terminal window) too early. To avoid this I inserted some extra control characters around the color codes to avoid it being counted by ReadLine. The last line before the return statement is for converting %% to %. That means: Use %% in colorparse() to output a literal %. --
In Section
Seekers of Perl Wisdom
|
|