in reply to Use of uninitialized value
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.
|
|---|