Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 wandering the Monastery: (5)
As of 2015-07-04 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls