in reply to Config file recommendations?

You might be interested in a poll, My preferred way of handling config data in Perl is:

If you really have to have Perl code in your config file, then the simplest solution is a file you can do or require. In fact, that option got the most votes in the poll I just referenced.

Replies are listed 'Best First'.
Re^2: Config file recommendations?
by Spidy (Chaplain) on Mar 19, 2008 at 14:52 UTC
    That does seem to be what I'm looking for - if I had a config file like this:
    %config = ( foo => bar, bat => baz, );
    How would I use that inside my Perl script, and have it globally available? Would require config; automatically setup the %config hash for the script that required it?

      I think maybe you're looking for Exporter. With it, you can have a module that will place a variable into the namespace of a program that uses it.

        This is what I've been trying, but it doesn't quite seem to work:

        use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(%config); %config = ( foo => bar, baz => bat );

        But I would still get the error Global symbol "%config" requires explicit package name. The code to use my config file was:

        use config;