On Fri, Mar 7, 2008 at 9:18 AM, Andrew Stringer <[EMAIL PROTECTED]> wrote:
>  I am not sure how an external config file fits with a perl module
>  though. Should a module be entirely self contained?

Well, one way is to do the way Perl itself (Config.pm) and CPAN.pm do
it - store the configuration in a Perl module.  CPAN lets you put it
in a MyConfig.pm file under your home directory or have a system-wide
CPAN::Config module.

But I think the most flexible way would be to just make the user pass
the configuration in as an argument, perhaps as a hashref.  In the
docs, you could suggest that the user store the configuration in a
Perl, YAML, or XML file but pass the information in as a hash.  I
think that makes it easiest for the user to control how they might
want to handle configuration in their own environment.

Reply via email to