open (SEQ, "<$ARGV[0]"); open (REP, "<$ARGV[1]"); open (OUT, ">$ARGV[2]"); while (){ $seq = $_; while (){ print OUT if /$seq/; } }