Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Validating against a Moose type-constraint without setting field

by stvn (Monsignor)
on Nov 23, 2011 at 19:23 UTC ( #939711=note: print w/ replies, xml ) Need Help??


in reply to Validating against a Moose type-constraint without setting field

You want this:

use Moose::Util::TypeConstraints qw[ find_type_constraint ]; # ... find_type_constraint('MyType')->check( $my_value );
Basically all this does it locate the underlying type constraint object for you. Alternately you could find the type constraint object in the actual class, which is explain in Moose::Cookbook::Snack::Types.

-stvn


Comment on Re: Validating against a Moose type-constraint without setting field
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939711]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2015-07-04 14:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls