Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Smart matching for argument constraints

by tobyink (Abbot)
on Sep 04, 2012 at 06:53 UTC ( #991557=note: print w/ replies, xml ) Need Help??


in reply to Smart matching for argument constraints

Personally I'd make the intent a little more obvious:

warn "wrong argument" if ref $arg{x} || !($arg{x} ~~ [qw/a b c/]);
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Smart matching for argument constraints
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2014-07-22 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (117 votes), past polls