Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
"be consistent"
 
PerlMonks  

Re: Why am I getting wrong result in counting the number and kind of 2-letter in 3-letter words in a string?

by toolic (Chancellor)
on May 01, 2012 at 13:39 UTC ( #968249=note: print w/ replies, xml ) Need Help??


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?

Add this to your code:

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


Comment on Re: Why am I getting wrong result in counting the number and kind of 2-letter in 3-letter words in a string?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968249]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2013-05-22 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (457 votes), past polls