Another rewrite attempt. Simplify everything you can. That makes your code easier to figure out in the future when you come back to it. Also, hashes can be nested, and I couldn't see a good reason to keep the @id array.

This may not work without some tweaking, but hopefully it will at least get you started.

#!/usr/bin/perl use Getopt::Long; &GetOptions('date=s' => \$date, 'dir=s' => \$directory, 'help' => \$help); &usage if ( defined $help || !defined $date ); my $PATH = "/Ack/$date/"; my $ftpoutbound = "/homes/ftpoutbound.db"; my %hash = (); opendir (DIR, $PATH) || die print "can't open dir $PATH at line 62 : $ +!\n"; my @FileList = readdir(DIR); close (DIR); foreach $FileList(@FileList) { next if $FileList =~ /^\.\.?$/; chomp $FileList; open (FILE, "$PATH$FileList") or die ("can't open $PATH$FileList :$ +!\n"); while(<FILE>) { @Fields = split /[\|\*~]/; # EDI data? $hash{$Fields[6]}{count}++ if ( $Fields[5] eq 'ZZ' ); # EDI? } } open (File, "$ftpoutbound") or die ("can't open $ftpoutbound at line * +* : $!\n"); while (<File>) { chomp; my @fields = split /\;/; $fields[0] =~ s/\s+//; $hash{$fields[0]}{transport} = $FTP_fields[7] if defined $hash{$FTP_ +fields[0]}; } print "$_ - $hash{$_}{count} - $hash{$_}{transport}\n" for keys %hash; sub usage { print "blah blah blah\n"; exit 1; }

In reply to Re: Help on displaying the output of two arrays by delirium
in thread Help on displaying the output of two arrays by Anonymous Monk

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.