Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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?
[msh210]: I don't have sendmail (I'm on MS Windows), so does one of you think you can report the bug?
[shmem]: msh210: 'tis about time to tell the sad truth to perl5porters - via perlbug
[msh210]: probably whoever wrote that actually knows the truth
[shmem]: msh210: you can save the perlbug text in a file and send that via your mail agent of choice
[msh210]: hm, okay, I'll try, thanks
[shmem]: ...not as an attachment, it's probably better to c&p that into the mail body

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2017-04-24 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (439 votes). Check out past polls.