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'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991557]
help
Chatterbox?
[Lady_Aleena]: Corion, I'm just hoping Cookies doesn't get too annoying.
[Corion]: Naah, if people got annoyed, they'd tell you ;)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-04-26 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (471 votes). Check out past polls.