Taking your sample data and original code I've generated the following sample code. Note that I added strictures and cleaned up a few other aspects of you code. I also removed the first line of your reference file so that at least one "missing" line would be reported.

use strict; use warnings; my $File1 = <<END_FILE1; GP_MASA_38C02_c GP_MASA_33B06_c GP_MASA_24D04_c GP_MASA_35A04_c END_FILE1 my $File2 = <<END_FILE2; 'GP_MASA_01F04_c',681,'ACCACACATCATCTGACTTACGTACGTACG...... 'GP_MASA_38C02_c',273,'ACATCCTTCACAGAAGTTTGT............. 'GP_MASA_33B06_c',288,'ACATACTAACACGGTCTTT............... END_FILE2 my $match = 0; open my $dataIn, '<', \$File2; while (<$dataIn>) { chomp ($_); my $dataLine = $_; open my $refIn, '<', \$File1; while (<$refIn>) { chomp ($_); my $str = $_; if ($dataLine =~ /$str/) { $match = 1; } } close ($refIn); if ($match == 0) { print "$dataLine\n"; } $match = 0; }

Prints:

'GP_MASA_01F04_c',681,'ACCACACATCATCTGACTTACGTACGTACG......

Although reparsing the reference file for each line of the data file is exceedingly nasty, the code works. Maybe you can update the sample to demonstrate where you are seeing a problem?


True laziness is hard work

In reply to Re^2: list lines not found in config (while+if) by GrandFather
in thread list lines not found in config (while+if) by tangledupinperl

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.