This question is a spin off of that was found in the last question I posted.

target_list is a hash I am using to determine my Unique Targets. If there is a better way of doing this please tell me. What am I doing wrong so that the only element that seems to be added to the @target_file array is the last element processed. The new pushs to the array are not adding the new @tfl_contents reference. Thanks again.

open(tfl_file, $target_file_layout) || die "Unable to open target +file layout metadata file $target_file_layout: $!\n"; foreach (<tfl_file>) { if($_ =~ /$ARGV[0]/){ chomp $_; @tfl_contents = split(/\&/, $_); if ($tfl_contents[9] ne ""){ $target_list{$tfl_contents[9]}++; push(@target_file, \@tfl_contents); } if ($debug eq "Y") { print "Source Found in Metadata: $_\n"; print "Contents Array = @tfl_contents\n"; print "Contents Ref = @$tfl_ref\n"; print "Element = $tfl_ref->[1]\n\n"; } } else{ #Do Nothing } } print Dumper(\@target_file); sleep; @tfl_list = keys %target_list; if ($debug eq "Y") { print "TARGET_LIST = @tfl_list\n"; } close(tfl_file);

In reply to Adding Array References to an Array by rheaton

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.