Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Use of uninitialized value

by frozenwithjoy (Priest)
on Aug 11, 2013 at 04:45 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1048972]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2018-01-20 05:48 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (226 votes). Check out past polls.