I'm building a count matrix in Perl using AoA: my @aoa = ()
then call $aoa[$i][$j]++
whenever I need to increment a specific cell. Since some cells are not incremented at all, they are left undef
(these are equivalent to 0 counts).
I would like to print some lines from the matrix, but I get errors for undef
cells (which I would simply like to print as zeros). what should I do?