Posted on 2008-06-27 14:31:03-07 by milpitian
Shouldn't this simple example pass validation?
use Params::Validate; sub foo { validate_pos ( @_, { type => SCALAR }); print $_[0]; } &foo ('hello'); [~] perl valid.pl Parameter #1 ("hello") has a type specification which is not a number. It is a string - SCALAR. Use the constants exported by Params::Validate to declare types. at valid.pl line 5 main::foo('hello') called at valid.pl line 9
Direct Responses: 11247 | Write a response
Posted on 2009-08-06 07:27:28-07 by dsadinoff in response to 8184
Re: Shouldn't this simple example pass validation?
SCALAR isn't exported by default. Use the following "use" statement instead:
use Params::Validate qw(:all);
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.