in reply to Type::Tiny and anyOf, oneOf
Not exactly sure what you want to accomplish but "any of" sounds like a union:
use Types::Standard qw( ArrayRef HashRef ScalarRef ); my ( @thing1, %thing2, $thing3 ); my $union = ArrayRef | HashRef; $union->check( \@thing1 ); # true $union->check( \%thing1 ); # true $union->check( \$thing1 ); # false ( ArrayRef | HashRef | ScalarRef )->check( \$thing1 ); # true
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Type::Tiny and anyOf, oneOf
by 1nickt (Canon) on Feb 03, 2021 at 00:04 UTC | |
by tobyink (Canon) on Feb 04, 2021 at 21:54 UTC |