Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Use method/function signatures with Perl

by xdg (Monsignor)
on Dec 06, 2004 at 19:52 UTC ( #412739=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Use method/function signatures with Perl
in thread Use method/function signatures with Perl

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.


Comment on Re^4: Use method/function signatures with Perl
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://412739]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2014-09-16 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (155 votes), past polls