Given pairs of string like this.
my $s1 = \"ACTGGA\"; my $s2 = \"AGTG-A\"; # Note the string can be longer than this.
I would
This is the easiest form you can get
my $s1 = "ACTGGA"; my $s2 = "AGTG-A"; my @s1 = split //,$s1; my @s2 = split //,$s2; my $i = 0; foreach (@s1) { if ($_ ne $s2[$i]) { print "$_, $s2[$i] $i\n"; } $i++; }