Re: Parameterized Type Intersections?
[email protected] (Karen Etheridge) Fri, 2 May 2014 09:40:31 -0700
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <20140502164030.GW29103@tequila> |
> I think you're suggesting being able to do appropos of:
>
> isa => Password[
> length => 6,
> matches => qr { },
> callback => sub { }
> ]
>
> I know this exists, which might help in implementing that:
>
> https://metacpan.org/pod/MooseX::Meta::TypeConstraint::Intersection
Yep, and also MooseX::Types::Structured which lets you create
data-dictionary-like types.
Remember also that you can manually create any types you like by writing a
custom verification sub:
my $custom_type = subtype,
from HashRef,
where { custom sub here };