in reply to Moose: Include Enum in Regex
Something like this help?
my @conf_enum_values = @{ Moose::Util::TypeConstraints::find_type_cons +traint('conf')->values };
Also, cos I'm me, here's the same thing using Type::Tiny type constraints instead:
use Types::Standard -types; my $Conf = Enum[qw/ access input /]; my $Version = Enum[1 .. 2]; my $FileName = StrMatch[qr/^(\w+)\.(\d+)\.txt$/, Tuple[$Conf, $Version +]]; has filename => (is => 'rw', isa => $FileName);
|
|---|