in reply to Re: Re: Re: How do you load configuration variables
in thread How do you load configuration variables

Hi there,

It's a good question, and it deserves a good answer: I cannot always choose my config files format. So my Foo::RC will create an abstraction layer on top of the config file.

Another goo reason is that this way I create the interfaces I like (which I would have anyway to write better code, eg.:

my $rc = new Foo:RC; my $ldap = Net::LDAP->new( $rc->ldap_data ); $ldap->bind( $rc->ldap_bind_data ) or die $@;

Among a wide amount of possible situations.

Granted, Foo::RC would use AppConfig or any other of the configuration modules available in CPAN. But when you have to read INI files, normal /etc/* kind of config files (hence calling the module RC), XML config files or config data stored in a LDAP directory, Foo::RC makes a lot of sense and life much more easier...

Best regards,

--
our $Perl6 is Fantastic;