* 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 $,=$"

Reply via email to