#!/usr/bin/perl -w use strict; my (@seq, @rep, $i, $n, $l, $t); open (SEQ, "<$ARGV[0]"); open (REP, "<$ARGV[1]"); open (OUT, ">$ARGV[2]"); $i=0; $n=0; $l=0; while (){ chomp(); $seq[$i] = $_; $i++; } while (){ $rep[$n] = $_; $n++; } while ($l < $i){ $t=0; while ($t < $n){ print OUT $rep[$t] if $rep[$t] =~ /$seq[$l]/; $t++; } $l++; } close (SEQ); close (REP); close (OUT);