Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Custom error messages and moose

by tobyink (Abbot)
on Sep 29, 2012 at 15:00 UTC ( #996386=note: print w/replies, xml ) Need Help??


in reply to Custom error messages and moose

Type constraints allow custom error messages. So you could create an "IPAddress" type constraint as a subtype of "Str", and provide an error message for that.

See Moose::Util::TypeConstraints.

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://996386]
help
Chatterbox?
choroba tries to solve Pascal's triangle at code-golf.io
[choroba]: so far so good, 51 :-)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-10-21 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (270 votes). Check out past polls.

    Notices?