Hi Deep Plaid,

.. I know a hash won't work because I will have rows of data with "keys" that are duplicated, and that have multiple values..
Really? Except I don't understand what you wanted. Am sure, hash would work perfectly, using the dataset you presented like so:

use warnings; use strict; use Data::Dumper; 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"; my %line; for ( split /\n/, $file ) { my @datas = split; push @{ $line{ $datas[0] }{ $datas[1] } }, $datas[2]; } { $Data::Dumper::Sortkeys = 1; $Data::Dumper::Indent = 3; print Dumper \%line; }
Which gives the following output:
$VAR1 = { '1.00' => { 'InDev' => [ #0 '01-Jun-2013' ], 'InProd' => [ #0 '15-Sep-2013' ], 'InTest' => [ #0 '15-Jul-2013' ], 'InUAT' => [ #0 '31-Jul-2013' ] }, '1.01' => { 'InDev' => [ #0 '01-Jul-2013' ] }, '2.00' => { 'InDev' => [ #0 '01-Aug-2013' ] }, '3.00' => { 'InDev' => [ #0 '01-Sep-2013' ] } };
So, one out of your questions, is actually done for you, the second one you can easily do. :)!
*I hope the above helps. You can also take a look at perldsc

* Update

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

In reply to Re: Dynamically build a table by 2teez
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.