Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 musing on the Monastery: (4)
As of 2014-09-24 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (245 votes), past polls