use strict; use warnings; my $array_ref = [undef]; if ($array_ref-> [0]->{whatever}){ print "true"; } else { print "false"; }