Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Use of uninitialized value

by frozenwithjoy (Priest)
on Aug 11, 2013 at 04:45 UTC ( [id://1048972]=note: print w/replies, xml ) Need Help??


in reply to Use of uninitialized value

Assuming line 64 is $lnPAM1[$i][$j]= ($lnPAM1[$i][$j]) /($mutrate*100);, you could try troubleshooting with something like this on the line before:
say "$lnPAM1[$i][$j]:$i:$j";

When I do this I see something like this snippet:

-3.91202300542815:3:7 -3.50655789731998:3:8 :3:9 :3:10 :3:11 :3:12 :3:13 :3:14 :3:15 :3:16 :3:17 :3:18 :3:19 -4.60517018598809:4:0 :4:1 :4:2 :4:3

Taking a look at where the matrix is built, it seems that the problem stems from your use of next in:

LINE: for (my $i=0; $i<20; $i++){ for (my $j=0; $j<20; $j++){ if ($matrix[$i][$j] > 0){ $lnPAM1[$i][$j] = log $matrix[$i][$j]; }else{ next LINE; } } }

By using next, you don't use all 20 iterations of i or j when building the matrix, but you do later on. You could look to see the dimensions of the matrix before iterating through its dimensions.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 02:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found