
perlFun
User
Aug 20, 2013, 4:39 PM
Post #1 of 2
(2920 views)
|
Using Param::validate (cpan param validation module) to validate a specific object type
|
Can't Post
|
|
I'm used to using Param::validate in the following way: my %opts = validate ( @_, { incomingParam => { type => ARRAYREF, optional => 0, }, } );#end param validation Where I have a scalar, arrayref, or hashref. Now I need to validate a specific object type. I looked at the cpan documentation and say the following types are allowed: http://search.cpan.org/~drolsky/Params-Validate-1.08/lib/Params/Validate.pm (look at the section on Type Validation) Specific you can specify "Object" if it's a blessed object, which my param is. But do you know if I can specify the type of object it is? I would like it to be a bit more specific than that, if possible, to use say an object that I myself have created.
|