Text::Table::Tiny - makes simple tables from two-dimensional arrays, with limited templating options
version 0.02
header_row
true/false, designate first row in $rows as a header row and separate with a line
separate_rows
true/false put a separator line between rows and use a thicker line for header separator
use Text::Table::Tiny; my $rows = [ # header row ['Name', 'Rank', 'Serial'], # rows ['alice', 'pvt', '123456'], ['bob', 'cpl', '98765321'], ['carol', 'brig gen', '8745'], ]; # separate rows puts lines between rows, header_row says that the first row is headers print Text::Table::Tiny::table(rows => $rows, separate_rows => 1, header_row => 1); Example in the synopsis: Text::Table::Tiny::table(rows => $rows); +-------+----------+----------+ | Name | Rank | Serial | | alice | pvt | 123456 | | bob | cpl | 98765321 | | carol | brig gen | 8745 | +-------+----------+----------+ with header_row: Text::Table::Tiny::table(rows => $rows, header_row => 1); +-------+----------+----------+ | Name | Rank | Serial | +-------+----------+----------+ | alice | pvt | 123456 | | bob | cpl | 98765321 | | carol | brig gen | 8745 | +-------+----------+----------+ with header_row and separate_rows: Text::Table::Tiny::table(rows => $rows, header_row => 1, separate_rows => 1); +-------+----------+----------+ | Name | Rank | Serial | O=======O==========O==========O | alice | pvt | 123456 | +-------+----------+----------+ | bob | cpl | 98765321 | +-------+----------+----------+ | carol | brig gen | 8745 | +-------+----------+----------+
$Text::Table::Tiny::COLUMN_SEPARATOR = '|';
$Text::Table::Tiny::ROW_SEPARATOR = '-';
$Text::Table::Tiny::CORNER_MARKER = '+';
$Text::Table::Tiny::HEADER_ROW_SEPARATOR = '=';
$Text::Table::Tiny::HEADER_CORNER_MARKER = 'O';
Creighton Higgins <chiggins@chiggins.com>
This software is copyright (c) 2012 by Creighton Higgins.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Text::Table::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Table::Tiny
CPAN shell
perl -MCPAN -e shell install Text::Table::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.