I atempted a modified version of your script and got this:
$ perl.exe perl2.pl
Global symbol "@data" requires explicit package name at perl2.pl line 27.
Can't find string terminator "|" anywhere before EOF at perl2.pl line 27.

#!/usr/bin/perl<br> use strict;<br> use warnings;<br> <br> # 777297<br> <br> my $data_file = "test1.txt";<br> open(DATA, $data_file) || die("Could not open file!");<br> my @data_file = &lt;DATA&gt;;<br> <br> my $names_file = "code.txt";<br> <br> open(NAMES, $names_file || die "Could not open file!");<br> my @names_data = &lt;NAMES&gt;;<br> <br> # create loop that reads each ID in code.txt (NAMES array), searches f +<br> #+or each in array elements for #test1.txt<br> # (DATA array), redirects a new (NAMES).html for each element<br> <br> my ($names, $data);<br> for $names(@names_data) {<br> &nbsp;&nbsp;&nbsp; chomp($names);<br> &nbsp;&nbsp;&nbsp; for $data(@data_file) {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chomp ($data);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($data =~ /$names/) {<br +> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "found \$names ( $names )&nbsp; in \$data \n";<br> push @data, qq | &gt; $names.html "\n";<br> &nbsp;}<br> &nbsp;&nbsp;&nbsp; }<br> }<br> <br> close NAMES;<br> close DATA;

In reply to Re^2: Line by line parsing from one file, comparing line by line to another file by web_developer
in thread Line by line parsing from one file, comparing line by line to another file by web_developer

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.