On Wed, 27 Jun 2001, Michael Fowler <[EMAIL PROTECTED]> wrote,

> On Wed, Jun 27, 2001 at 06:58:37PM +0200, Jos I. Boumans wrote:
> > I usually use a config file for this
> > now you could do this 3 ways as i see it
> >
> > -    just have a file that holds a lot of global vars and 'require/use' that
> > in your mian script
> > -    get one hashref that you globalise and thus reduce namespace pollution
> > -    make it a module, give it a constructor returning a hashref and thus
> > not polluting *anything*
>
> There are other methods for getting configuration information from an
> external file.
>
>     4) Parse some specific configuration file format, and then provide
>        access to the data from it via a hash or object.  There are various
>        modules available on CPAN for this
>        (http://www.cpan.org/modules/00modlist.long.html#ID12_Option_Arg).
>
>     5) Parse a file written in Perl, that sets a lot of global variables,
>        into a hash, such as what Parse::PerlConfig (by yours truly) does
>        (http://www.cpan.org/authors/id/M/MF/MFOWLER/Parse-PerlConfig-0.05.tar.gz).
>

Additionally,

    6). Use XML to build more complex configuration.
    7). do()-ing the file instead of require()-ing it.


__END__
-- 
s::a::n->http(www.trabas.com)


Reply via email to