Muthukumar <mailto:[EMAIL PROTECTED]> wrote:
No, I don't think so. Let's test it. We'll assume that <FD> has 3 lines in it. On the first pass of the outer loop we load the first value from "file1." We then compare it to each value in "file2." Fine so far. On the second pass of the outer loop we load the second value from "file1." But FD1 is at the end of the file, so there is nothing to compare the second value to. On the third pass of the outer loop we load the third value from "file1." But FD1 is at the end of the file, so there is nothing to compare the third value to. This algorithm is fundamentally flawed. : while (<FD>) : { : $line1=chomp($_); # chomp() Needed : : while (<FD1>) : { : $line = chomp($_); # chomp() Needed : if ($line =~ /.*$line1.*/) # (.*)Not needed : { : print "Got the String\n"; : } : : } : } : Revert on having more queries. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>