use List::MoreUtils qw/ any all /; #Here is an "or" condition. if( any { $_ == 1 } ( 1, 2, 3 ) ) { print "True.\n"; # This one is true because one of the elements matched. } #Here is an "and" condition. if( all { $_ == 1 } ( 1, 2, 3 ) ) { print "True.\n"; # This one is NOT true, because only one of the three elements matched. }