Your code is incomplete, as i don't see assignment of Program Reviewer, rev, etc. Also i don't see how you can fill different JIRA and Program with same data (@records).

There is no example how your input looks like. It's difficult to figure out how it should be done.

Below is short example of how data can be processed:

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Terse = 1; my $hash = {}; foreach my $line ( <DATA> ) { chomp $line; my ( $jira, $program, $rev, $reviewer, $desc ) = split /:/, $line; my $data = { JIRA => $jira, Program => $program, rev => $rev, Reviewer => $reviewer, Description => $desc, }; push @{ $hash->{ $program }}, $data; } print 'hash = ' . Dumper( $hash ); __DATA__ COM-6789:Testing:r876391:Balise Mat:Audited COM-6789:Testing:r698392:Chan Joe:SO hwat COM-6789:Testing:r327896:Chan Joe:Paid the Due COM-1234:Development:r345676:John Wick:General fix COM-1234:Development:r909276:None:Updating Received
which has the following data:
hash = { 'Development' => [ { 'Description' => 'General fix', 'JIRA' => 'COM-1234', 'Program' => 'Development', 'Reviewer' => 'John Wick', 'rev' => 'r345676' }, { 'Description' => 'Updating Received', 'JIRA' => 'COM-1234', 'Program' => 'Development', 'Reviewer' => 'None', 'rev' => 'r909276' } ], 'Testing' => [ { 'Description' => 'Audited', 'JIRA' => 'COM-6789', 'Program' => 'Testing', 'Reviewer' => 'Balise Mat', 'rev' => 'r876391' }, { 'Description' => 'SO hwat', 'JIRA' => 'COM-6789', 'Program' => 'Testing', 'Reviewer' => 'Chan Joe', 'rev' => 'r698392' }, { 'Description' => 'Paid the Due', 'JIRA' => 'COM-6789', 'Program' => 'Testing', 'Reviewer' => 'Chan Joe', 'rev' => 'r327896' } ] }

In reply to Re: Hash of Hash of Arrays by duyet
in thread Hash of Hash of Arrays by voltas

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.