# this always works print "@a\n" if defined(List::Util::first { defined($_) && 0 == $_ } @a); #### # doesn't work print "@a\n" if defined(List::Util::first { !defined($_) } @a);