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).
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--