Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 (Bishop)
on May 01, 2012 at 13:39 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://968249]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found