Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by stvn (Monsignor)
on Nov 23, 2011 at 19:23 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-28 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found