for my $oligo_indice ( 0 .. $#{ $self->{oligo_ref} } ) { # INSERT debug code below - this must be around line 474 : for my $j (0 .. $#{ $self->{hd_matrix_ref}->[$oligo_indice] }){ die "problem with hd_matrix_ref index '$oligo_indice/$j'" unless defined $self->{hd_matrix_ref}->[$oligo_indice][$j]; } # END insert debug code $hd_sum[$oligo_indice] = List::Util::sum( @{ $self->{hd_matrix_ref}->[$oligo_indice] } ); }