Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Moose Attribute constraint: Regex OR undef

by Corion (Patriarch)
on Oct 31, 2016 at 12:19 UTC ( [id://1175013]=note: print w/replies, xml ) Need Help??


in reply to Moose Attribute constraint: Regex OR undef

Can you show us a short program that shows the intended usage of your class? Also, what errors do you currently get (or not)?

I assume that where takes a subroutine reference which gets the thing to test in $_, so maybe the following already is enough?

... where { not defined $_ or $_ =~ /$regEx/ }

Update: Negated the expression, thanks to 1nickt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1175013]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found