http://www.perlmonks.org?node_id=994207


in reply to Help with Moose subtype

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:

$#!T

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'