LaTeX-Table

 view release on metacpan or  search on metacpan

bin/ltpretty  view on Meta::CPAN

# remove trailing empty lines
while ( !length $input[-1] ) {
    pop @input;
}

# uncomment original input
_say( join q{}, map {"\n % $_"} ( $paramline, @input ) );

# create rows/column array[array_ref], remove leading and trailing spaces
@input = map {
    [ map { m{\A \s* (.*) \s* \z}xms ? $1 : $_ } split m{ & }xms ]
} @input;

# store the paramline in a hash
my %params = map { _parse_param($_) } split m{ ; }xms, $paramline;

my $table = LaTeX::Table->new(
    {   header => [ $input[0] ],
        data   => [ @input[ 1 .. $#input ] ],
        %params,
    }
);

_say( "\n" . $table->generate_string() );



( run in 0.931 second using v1.01-cache-2.11-cpan-71847e10f99 )