my $str1 = 'ATTTA'; my $str2 = 'TTTAA'; $merged_result12 = 'ATTTAA'; #### my $str2 = 'ATGTA'; my $str3 = 'ATGTA'; $merged_result23 = 'ATGTA'; #### When there are more than one possibilities of merging like below. We take the "last" merge. my $str3 = 'ATGATG'; my $str4 = 'ATGATG'; $merged_result34 = 'ATGATGATG';