if (defined $array[$i][$j]) { print $array[$i][$j]; } else { print ''; }