in reply to Why am I getting wrong result in counting the number and kind of 2-letter in 3-letter words in a string?
use Data::Dumper; $Data::Dumper::Sortkeys=1; print Dumper(\%third);
Does this output look right to you?:
$VAR1 = { 'AC' => 0, 'AT' => 0, 'C' => 4, 'TC' => 0 };
If not, I agree that Line 15 is not what you want. See also Basic debugging checklist. How about:
$third{ substr($tri,0,1) . substr($tri,2,1) }++; # Line 15
|
|---|