my @arr = (undef); if (exists $arr[0]) { say 'yes'; } else { say 'no'; } say $arr[0]; --output:-- yes Use of uninitialized value $arr[0] in say at 1.pl line 14.