Given pairs of string like this.
my $s1 = "ACTGGA";
my $s2 = "AGTG-A";
# Note the string can be longer than this.
# But they are always of the same length.
I would like to find position and character in in $s1 where it differs with $s2. In this case the answer would be:
#String Position 0-based
# First col = Base in S1
# Second col = Base in S2
# Third col = Position in S1 where they differ
C G 1
G - 4
I can achieve that easily with substr(). But it is horribly slow. Typically I need to compare millions of such pairs.
Is there a fast way to achieve that?
neversaint and everlastingly indebted.......