|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Help with Moose subtypeby tobyink (Prior) |
| on Sep 18, 2012 at 07:08 UTC ( #994207=note: print w/ replies, xml ) | Need Help?? |
|
mbethke is correct. You've also got a problem with your regular expression. Currently, the following string passes your type constraint, when I assume from your description that you expected it to fail:
The regexp I think you want is: /^[A-Za-z0-9]*$/.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||