I guess I can do that, but I think having a 1 liner BUILD subroutine is simpler than writing an extension to Config::Any.
I'm afraid of starting a YAML vs. The World flamewar, but I don't like YAML since it differs between white space and tab-created whitespace and a few other small nuisances with it which effect the outcome and hard to debug. It's not that readable as it claims. I might just have to use it anyway though since it does provide a fair lot of functionality. Thanks for the ideas. On Thu, Oct 30, 2008 at 6:10 AM, Jonathan Rockway <[EMAIL PROTECTED]> wrote: > * On Wed, Oct 29 2008, sawyer x wrote: >> I'm using Moose with MooseX::SimpleConfig >> I guess it'd be nicer if the configuration module (Config::Any) or >> even MooseX::SimpleConfig role would do this instead of having to do >> >> sub BUILD { >> my $self = shift; >> $self->method( [ split /,/, $self->method ] ); >> } > > In this case, I think you can write a custom Config::Any plugin: > > package Config::Any::Foo; > sub extensions { 'foo' } > sub load { > my ($class, $filename, $args) = @_; > ... > if( whatever ) { split /, /, ... } > return ... > } > > Then if you have a .foo file, this code will run to load it. Totally > untested, but something like this should work. > > BTW, I would just use YAML (or JSON) here. Config::General is one of > the ugliest file formats I've ever seen, and it maps poorly to Perl. > YAML is nice looking and maps perfectly to Perl. > > Regards, > Jonathan Rockway > > -- > print just => another => perl => hacker => if $,=$" >