Text-ASCIITable reviews

cpanratings
 

RSS | Module Info | Add a review of Text-ASCIITable

Text-ASCIITable (0.18) ****

The module may be aging a bit,
but it was quite simple to use and was exactly what I needed.
I had a nice easy-to-read table in my terminal
with 3 lines of code (plus 1 for the require).
Thanks!

Text-ASCIITable (0.18) **

The module could be very useful tool but it is almost unusable due to very bad performance. For example drawing a table which has 350 rows and 10 columns takes ~60 seconds on Intel(R) Xeon(R) 1.86GHz. I did a quick glance on code and my impression is that it has O(x^2) complexity where x is number of rows what obviously doesn't scale very well. It seems the author is aware of the problem as one of comments in the source code says "This function must be totally rewritten one day, it is really slow, and ... dumb. ;)"

Text-ASCIITable (0.15) ****

I had to produce a simple report with ASCII characters, you know, like

+-----+-----+

| foo | bar |

+-----+-----+

| 734 | agd | <-- imagine this in a nice monospace font

| 13 | pe |

| 82 | fx |

+-----+-----+

And this module was just what I needed. It was easy enough to use, the documentation was quite straightforwad to understand, although I have a few minor niggles.

It uses CamelCaseMethodNames, which I dislike. It would be nice to have aliased names to uncamel_case_method_names as a forward/backward compatibility shim.

Another hassle is that you can't pass an arrayref of arrayrefs to the addRow() method. This is a pity, because it would admit the following code:

$t->addRow( $db->selectall_arrayref( $sql_command ));

The final hassle that I encountered is that it warns copiously about undefined values. In my particular SQL request some column values are undef, and it is normal. It would be nice to have a property to set to treat_undef_as_no_space or something. I had to write the above snippet as

my $r = $db->selectall_arrayref( $sql_command );

$t->addRow( map { defined($_) ? $_ : '' } @$_ ) for @$r;

But that took me about 3 minutes flat, so it's not much of a problem, more something to be aware of.

I'll write up these reports as bugs, and we'll see how the author responds.

All in all a very useful module, and nice to have in your toolbox.