mercuryshipz has asked for the wisdom of the Perl Monks concerning the following question:


hi,
I wanna know abt the configuration files... when i googled it, most of the examples used packages like Config::Tiny etc.. but i dont have those packages on my server and i dont have privileges to install em... i wanna know the format of conf files and how to use in our script and so on... any resources or websites u guys can suggest....

thanks.

Replies are listed 'Best First'.
Re: Config file
by apl (Monsignor) on Feb 20, 2008 at 16:04 UTC
    A configuration file can be anything you want it to be, as long as you're consistant.

    If you can't use a CPAN package, you could use do on a file that has Perl code defining your parameters.

    Or you could parse parameters from the run-string, using $ARGV.

Re: Config file
by adiabat (Acolyte) on Feb 20, 2008 at 18:28 UTC

    If you don't have privileges to install packages on the server in the usual way, you should still be able to put them somewhere in your home directory. You might create a ~/perllib directory and install Config-Tiny there.

Re: Config file
by dynamo (Chaplain) on Feb 20, 2008 at 18:53 UTC
    Look into YAML, it's a great format for config files, very widely used across multiple languages and easy for humans to edit. Also, you can add it to your source tree wherever you have your other modules, and it will work.