I think if you read the POD closely, you'll see Params::Validate does what you want. E.g. (from the POD,
my @p = validate( @_, 1, { default => 99 } );
You can also set a global on_fail callback to die however you want.
-xdg
Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.
In reply to Re^4: Use method/function signatures with Perl
by xdg
in thread Use method/function signatures with Perl
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |