Text::Matrix.pm is a specialist table display module for display of matrices of single-character (such as Y/N for yes/no) or short multi-character data against row and column labels that are sufficiently longer that conventional table layouts distort the layout of the data.

The core aim is to base the layout on the tabular data concisely and formated regularly to reflect the terseness of the underlying data, without being forced to compensate for the longer length of the labels for the columns and rows.

Text::Matrix.pm will also optionally split the matrix into several sections based on width of the generated matrix, suitable for display in situations where you don't want external line-wrapping to confuse the layout. (Display on an xterm, cut-n-paste into an email, etc.)

You can find more on the Text-Matrix Distribution CPAN page.

You can find more on my GitHub page for Text::Matrix.pm.

Recent blog entries for Text::Matrix.pm

Text::Matrix.pm Released

Date: Wednesday, 14 April 2010, 17:31.

Categories: perl, ironman, text-matrix, template-benchmark, qa.

Even with twenty thousand distributions on CPAN, a figure that should truly boggle the mind, I'm still often surprised to find myself trying to do something reasonably basic that hasn't been covered already.

While writing Template::Benchmark I wanted to lay out a "feature matrix", a matrix of template engines and the features they supported: a simple grid of Y/N characters in even, regular spacing.

To my surprise none of the CPAN table modules covered this, they'd all force the layout to depend on the width of the column labels or try to force the column labels to wrap at single-character width. So I hacked together some ugly code myself and got on with writing the rest of Template::Benchmark.

As with all ugly one-off code though, you find yourself wanting to use it elsewhere and constrained by how un-resuable it is.

Well, I did what I should have done in the first place, I made it Text::Matrix - Text table layout for matrices of short regular data.

Only a beta 0.99_01 release, but should be hitting a CPAN mirror near you shortly if it isn't there already.

See below the cut for example output and more details.

© 2009-2013 Sam Graham, unless otherwise noted. All rights reserved.