Hi rruser,
I can't figure out how to combine my two files to get the desired output.
Since, you are reading both files the same way there is no need doing the same it over and over again.
If I may give you a head up, something like so:

use warnings; use strict; use Data::Dumper; my %collector; foreach my $file (@ARGV) { open my $fh, '<', $file or die $!; while (<$fh>) { chomp; my @vals = split /,/, $_, 4; if ( !exists $collector{ $vals[0] } ) { $collector{ $vals[0] } = [ @vals[ 1 .. 3 ] ]; } else { push @{ $collector{ $vals[0] } }, $vals[2]; } } } print Dumper \%collector;
Output:
$VAR1 = { 'CRDX 7067' => [ ' L', ' 04/05/13', ' TYCO', ' 04/20/13' ], 'AOKX 495408' => [ ' L', ' 04/02/13', ' SWCOMP', ' 04/20/13', ' 04/15/13' ], 'BLHX 102' => [ ' L', ' 04/01/13', ' WILDCOM', ' 04/03/13', ' 04/30/13' ], 'WW 9030' => [ ' L', ' 04/02/13', ' HALLI', ' 04/30/13' ] };
Do the display as you wish, sir... :)

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: combining 2 files with 4 columns need help by 2teez
in thread combining 2 files with 4 columns need help by rruser

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.