Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 wandering the Monastery: (12)
As of 2014-12-22 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (131 votes), past polls