in reply to Problem printing in colors

Why adding the underline constant messes with my spacing?
Because the "underline constant" is an ANSI sequence, which in turn is nothing but a string and perl -or better: sprintf()- takes its lenght into account, but then its length "disappears" when it is interpreted by the terminal.