Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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?
[1nickt]: yes.
[1nickt]: one of the largest distros
[Corion]: I wait for the day when DateTime uses Moose ;)
[TCLion]: finaly finished the install wow that was over 10 min
[1nickt]: Corion using Moose will hardly reduce the number of dependencies or time to install DT !
[davido]: That's like wishing that your motorcycle came with a sherman tank as a trailer.
[Corion]: davido: No, more like my one sherman tank had a second sherman tank tied to its back ;)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-03-23 15:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (289 votes). Check out past polls.