TypeConstraints message

2010-01-19 Thread Dermot
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

Re: TypeConstraints message

2010-01-19 Thread Hans Dieter Pearcey
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

Re: TypeConstraints message

2010-01-19 Thread Dermot
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'.

Re: TypeConstraints message

2010-01-19 Thread Hans Dieter Pearcey
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,

Re: TypeConstraints message

2010-01-19 Thread Dermot
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