if (3 != grep {exists $item->{$_}} qw(foo bar baz)) { warn ....; # but your warning can't be as specific. next; }