perl -e '@array; $array[2]=undef; $array[2][2]=undef; foreach($array[2]){print "yes"}' # Output: yes