[Israel.pm] text coloring

Gaal Yahas gaal at forum2.org
Sun Nov 19 03:05:53 PST 2006

On Sun, Nov 19, 2006 at 12:50:33PM +0200, Yossi Itzkovich wrote:
> Is there a way to give colored text in a standard way ?  We are doing it
> here with:
> $red="\033[31m";
> $black="\033[30m";
> $yellow="\033[35m";
> and it looks OK in xterm/dtterm, but vi and excel show no color but the
> gibberish text.
Color codes are part of some kind of agreement between whoever emits the
codes and whoever renders the text. In the case of your terminals, they
are designed to interpret those as in-band color codes; vi, being an
explicit editor, shows the closest thing it can that represents "the
literal truth" of your file; Excel is playing a different game

> Is there a way to do it ?

Not universally.

Gaal Yahas <gaal at forum2.org>

More information about the Perl mailing list