in reply to compare two text files
If i understood your question correctly this should work for you. This can be done still efficiently.
open (GEN, "<general.txt") || die ("cannot open general.txt"); open (SEA, "<search.txt") || die ("cannot open search.txt"); undef $/; $gen = <GEN>; $sea = <SEA>; @gen = split /\n/, $gen; @sea = split /\n/, $sea; for $a (@gen) { @result = grep/^\Q$a\E$/, @sea; push (@final , @result); } print "Search string that matches against general data:\t@final";
Prasad
In Section
Seekers of Perl Wisdom