|
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
|