[Pkg-catalyst-maintainers] Bug#402906: multirow pushing not working?

Salvatore Bonaccorso salvatore.bonaccorso at gmail.com
Sun Jun 14 08:51:38 UTC 2009


Hi Håkon Nessjøen

In Debian BTS we have a bugreport regarding the multirow pushing not
working [1].
 
 [1] http://bugs.debian.org/402906

Indeed the following example does not work if I pass an 4x3 array:
----------------------------------------------------------------------
#!/usr/bin/perl
use Text::ASCIITable;
$t = Text::ASCIITable->new();
$t->setCols('one','two','three');
$t->addRow([
	[ 1, 2, 3 ],
	[ 4, 5, 6 ],
	[ 7, 8, 9 ],
	[ 0, 0, 0 ]
]);
print $t->draw();
----------------------------------------------------------------------

It produces the following output:
Received too many columns at ./ansi-example.pl line 5

.-------------------.
| one | two | three |
+-----+-----+-------+
'-----+-----+-------'

Removing the [0, 0, 0] indeed gives:

.-------------------.
| one | two | three |
+-----+-----+-------+
|   1 |   2 |     3 |
|   4 |   5 |     6 |
|   7 |   8 |     9 |
'-----+-----+-------'

The Bugreporter notices that the problem should:
The problem is that the check for the right number of 
columns in addRow() checks the first dimension of the passed array,
which is correct if you pass a single row but incorrect if you pass 
an array of rows. Therefore, this only happens to work if you pass 
less rows than columns.

Could you please have a look into it?
Many thanks for developing this nice Perl module,

Kind regards
Salvatore
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-catalyst-maintainers/attachments/20090614/7dbdd042/attachment.pgp>


More information about the Pkg-catalyst-maintainers mailing list