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 meditating upon the Monastery: (9)
As of 2016-08-27 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (389 votes). Check out past polls.