# e.g @lines1 contains CACTATGAGTGATCGC and @lines2 contains # ACTGACTAATGCGTTG. @lines1= split(//,"CACTATGAGTGATCGC"); @lines2= split(//,"ACTGACTAATGCGTTG"); $line1length=@lines1; $line2length=@lines2; print ("1 :",@lines1,"\n"); print ("2 :",@lines2,"\n"); if ($line1length!=$line2length) { print "Length Mismatch\n"; } else { print "M :"; for ($x=0;$x<$line1length;$x++) { if ($lines1[$x] eq $lines2[$x]) { print $lines1[$x]; } else { print "*"; } } print "\n"; }