Skip Menu |

This queue is for tickets about the Text-ASCIITable CPAN distribution.

Report information
The Basics
Id: 102865
Status: new
Priority: 0/
Queue: Text-ASCIITable

People
Owner: Nobody in particular
Requestors: MORITZ [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.20
Fixed in: (no value)



Subject: allowANSI breaks table alignment if two identical column names are used
This example code: use 5.014; use strict; use warnings; my @data = ( [0, 'xxxxxxx xxxxxxx' , 'xxxxxxx'], [0, 'xxxxxxxxxxx xxxxxxx' , 'xxxxxxx'], [0, 'xxxxxxxx-xxxxxxx' , 'xxxxxxxx'], [0, 'xxxxxxxx-xxxxxxx' , 'xxxxxxxx'], [0, 'xxxx-xxxxxxxx xxxxxxx' , 'xxxx-xxxxxxxx'], [0, 'xxxxxxxxx-xxxxxxx' , 'xxxxxxxxx-xxxxxxx'], [1, 'xxxxxxxxxxxxxx xxxxxx' , 'xxxxxxx'], [1, 'xxxxxx xxxxxxxxxx' , 'xxxxxxx'], ); use Text::ASCIITable; my $t = Text::ASCIITable->new(); $t->setCols('rank', 'name', 'name'); $t->setOptions(allowANSI => 1); $t->addRow(@$_) for @data; print $t; produces: .----------------------------------------------. | rank | name | name | +------+-------------------+-------------------+ | 0 | xxxxxxx xxxxxxx | xxxxxxx | | 0 | xxxxxxxxxxx xxxxxxx | xxxxxxx | | 0 | xxxxxxxx-xxxxxxx | xxxxxxxx | | 0 | xxxxxxxx-xxxxxxx | xxxxxxxx | | 0 | xxxx-xxxxxxxx xxxxxxx | xxxx-xxxxxxxx | | 0 | xxxxxxxxx-xxxxxxx | xxxxxxxxx-xxxxxxx | | 1 | xxxxxxxxxxxxxx xxxxxx | xxxxxxx | | 1 | xxxxxx xxxxxxxxxx | xxxxxxx | '------+-------------------+-------------------' It works fine if either the column names are distinct, or allowANSI isn't set.