Subject: | Use of Term::ANSIColor upsets alignment |
Date: | Wed, 29 Feb 2012 11:14:01 +0100 |
To: | bug-Text-Table [...] rt.cpan.org |
From: | Per Carlson <pelle [...] hemmop.com> |
Hi.
When trying to color a cell with Term::ANSIColor I do get misalignment
of the output. When, for example, using the table from the POD I get
this:
pelle@devel:~/tmp$ cat tt.pl
use Text::Table;
use Term::ANSIColor;
my $tb = Text::Table->new(
"Planet", "Radius\nkm", "Density\ng/cm^3"
);
$tb->load(
[ colored("Mercury", "green"), 2360, 3.7 ],
[ "Venus", 6110, 5.1 ],
[ "Earth", 6378, 5.52 ],
[ "Jupiter", 71030, 1.3 ],
);
print $tb;
pelle@devel:~/tmp$
pelle@devel:~/tmp$ perl ./tt.pl
Planet Radius Density
km g/cm^3
Mercury 2360 3.7
Venus 6110 5.1
Earth 6378 5.52
Jupiter 71030 1.3
I'm running this on Debian stable with Text::Table from unstable (to
get color support):
pelle@devel:~/tmp$ perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
pelle@devel:~/tmp$ apt-cache policy libtext-table-perl
libtext-table-perl:
Installed: 1.123-1
Candidate: 1.123-1
Version table:
*** 1.123-1 0
500 http://ftp.no.debian.org/debian/ unstable/main amd64 Packages
100 /var/lib/dpkg/status
1.114-1 0
900 http://ftp.no.debian.org/debian/ squeeze/main amd64 Packages
TIA
--
Pelle
"D’ä e å, vett ja”, skrek ja, för ja ble rasen,
”å i åa ä e ö, hörer han lite, d’ä e å, å i åa ä e ö"
- Gustav Fröding, 1895