Hi,
I'm using the enum() constraints for a attribute. It works fine like this:
has 'index_type' = (
is = 'ro',
isa = enum($_, qw(for bar baz)),
required = 1,
);
But I'd like to provide a friendlier message
Excerpts from Dermot's message of Tue Jan 19 08:28:55 -0500 2010:
2010/1/19 Hans Dieter Pearcey h...@pobox.com:
subtype 'Whatever', as enum([ qw(foo bar baz) ]), ...;
^
So the answer is use 'as'.
Yes, that is *part* of the answer. Look at
2010/1/19 Hans Dieter Pearcey h...@pobox.com:
Excerpts from Dermot's message of Tue Jan 19 08:28:55 -0500 2010:
2010/1/19 Hans Dieter Pearcey h...@pobox.com:
subtype 'Whatever', as enum([ qw(foo bar baz) ]), ...;
^
So the answer is use 'as'.
Excerpts from Dermot's message of Tue Jan 19 11:00:41 -0500 2010:
my $indexer = MyApp::Local::Indexer-new(index_type='foobarquin);
I thought $_ was the value passed by the constructor arguments. In
this case, $_ ='foobarquin' and it would been used to cmp against the
strings in the array.
No,
2010/1/19 Hans Dieter Pearcey h...@pobox.com:
Excerpts from Dermot's message of Tue Jan 19 11:00:41 -0500 2010:
my $indexer = MyApp::Local::Indexer-new(index_type='foobarquin);
I thought $_ was the value passed by the constructor arguments. In
this case, $_ ='foobarquin' and it would been used