my $oldstring = 'ATTGC---AGTCCATGC------ATGC' my $newstring = 'AT-TGC---AGTCCATGC------ATGC' desired output: gap of length 1 at position 3 gap of length 1 at somewhere between position 20 and 27