use 5.010; use strict; use warnings; use List::MoreUtils qw/ any /; my $s = "foo"; my @list = ( 1, undef, 2 ); given($s) { when('foo') { say "found undef" if any { ! defined($_) } @list; } }