[Catalyst] [Task] A new ASCIITable module

Sebastian Riedel sri at oook.de
Fri Nov 4 05:55:03 CET 2005


Am 02.11.2005 um 04:47 schrieb Sebastian Riedel:
> We definately need something new!
>
> Here's my feature wishlist:
> * NO MEMLEAKS! :)
> * no camelcase methods
> * line wrapping on non-whitespace characters
> * optional column title
> * configurable border characters
> * fixed table width

Well, i've spent the last 3 hours writing Text::SimpleTable, it  
should hit a CPAN mirror near you soon. :)

Obligatory examples:

            use Text::SimpleTable;

            my $t1 = Text::SimpleTable->new( 5, 10 );
            $t1->row( 'foobarbaz', 'yadayadayada' );
            print $t1->draw;

            .-------+------------.
            | foob- | yadayaday- |
            | arbaz | ada        |
            '-------+------------'

            my $t2 = Text::SimpleTable->new( [ 5, 'Foo' ], [ 10,  
'Bar' ] );
            $t2->row( 'foobarbaz', 'yadayadayada' );
            $t2->row( 'barbarbarbarbar', 'yada' );
            print $t2->draw;
            .-------+------------.
            | Foo   | Bar        |
            +-------+------------+
            | foob- | yadayaday- |
            | arbaz | ada        |
            | barb- | yada       |
            | arba- |            |
            | rbar- |            |
            | bar   |            |
            '-------+------------'


--
sebastian




More information about the Catalyst mailing list