my $type = Dict->of( foo => Str, baz => Optional[Int], qux => Optional[Str], )->where(q{ exists $_->{baz} or exists $_->{qux} }); if ( $type->check( \%somehash ) ) { say "matched"; }