CC: | 402170 [...] rt.noris.net |
Subject: | single "0"s in headlines do not get printed |
If I do...
use Text::ASCIITable;
my $t = Text::ASCIITable->new({ headingText => 'Test' });
$t->setCols("f\n0\n0");
print $t;
... I get...
.------.
| Test |
+------+
| f |
| |
| |
+------+
'------'
That is, the "0"s in lines two and three of the headlines are missing.
A patch to fix that is attached.
(The last change within this patch is of course not necessary to fix the
problem, but an optimization to save copying @tmp right before it goes
out of scope, anyway.)
Regards,
fany
Subject: | Text::ASCIITable.patch |
--- /usr/local/lib/perl5/site_perl/5.10.0/Text/ASCIITable.pm 2008-02-04 11:20:37.000000000 +0100
+++ Text/ASCIITable.pm 2008-02-06 16:08:48.000000000 +0100
@@ -4,7 +4,7 @@
@ISA=qw(Exporter);
@EXPORT = qw();
@EXPORT_OK = qw();
-$VERSION = '0.18';
+$VERSION = '0.181';
use Exporter;
use strict;
use Carp;
@@ -113,8 +113,8 @@
my @out;
grep {$max = scalar(@{$_}) if scalar(@{$_}) > $max} @lines;
foreach my $num (0..($max-1)) {
- my @tmp = map { @{$_}[$num] || '' } @lines;
- push @out, [ @tmp ];
+ my @tmp = map defined $$_[$num] && $$_[$num], @lines;
+ push @out, \@tmp;
}
@{$self->{tbl_cols}} = @_;