Borrowing from 2teez's solution, the table could be loaded like this.

Update A possible change of code to fit Deep_Plaid's followup question.

#!/usr/bin/perl use strict; use warnings; use Text::Table; my $file = "1.00 InDev 01-Jun-2013 1.00 InTest 15-Jul-2013 1.00 InUAT 31-Jul-2013 1.00 InProd 15-Sep-2013 1.01 InDev 01-Jul-2013 2.00 InDev 01-Aug-2013 3.00 InDev 01-Sep-2013"; open my $fh, '<', \$file; my %line; while (<$fh>) { my ($ver, $status, $date) = split; $line{ $ver }{ $status } = $date; } my @status = qw/ InDev InTest InUAT InProd /; my @module = (undef, qw/ IXR Reports Three /); my $tb = Text::Table->new( "Module", "Version", @status ); for my $ver (sort keys %line) { my ($i) = $ver =~ /(\d+)/; $tb->load([ $module[$i], $ver, map $_ // 'N/A', @{$line{$ver}}{ @s +tatus } ]); } print $tb;
Produces output:
Module Version InDev InTest InUAT InProd IXR 1.00 01-Jun-2013 15-Jul-2013 31-Jul-2013 15-Sep-2013 IXR 1.01 01-Jul-2013 N/A N/A N/A Reports 2.00 01-Aug-2013 N/A N/A N/A Three 3.00 01-Sep-2013 N/A N/A N/A

In reply to Re: Dynamically build a table by Cristoforo
in thread Dynamically build a table by Deep_Plaid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.