PBib::Config - Configuration for PBib
use PBib::Config; $conf = new PBib::Config();
Handle the configuration for PBib. It looks in cmd-line args, environment, and at various places at config files.
In fact, this module contains no code specific to PBib, so you might be able to use it for your own applications as well.
New creates a new Config object. Upon creation, it reads the standard config from command-line, environment, site- and user-preferences. Options:
If true, check @ARGV.
If true, check $ENV{'PBIB'};
If true, read site configuration file ("local.pbib") -- whereever it is found ...
If true, read user configuration file ("user.pbib") -- whereever it is found ...
Ref to a hash with the default configuration.
Be more verbose and keep the verbose flag within the options.
Be more quite and keep the quiet flag within the options.
Return a hash ref with all options. If the optional filename is given, it looks for additional options for this file by checking for a pbib.pbib file in this directory and for a file with .pbib as extension. Options:
Look for additional options for this file in "$filename.pbib"
Look in this dir for additional "local.pbib"
Return the option.
If $new_val is given, the option is set to the new value and the old value is returned.
Overwrite the configuration stored internally.
If true, more verbose output should be produced.
If true, more quiet output should be produced.
load config, as specified in new(). It will overwrite the configuration stored internally.
the following places are searched for all config files:
If $HOME is set, pbib searches: $ENV{HOME}/.pbib/styles $ENV{HOME}/.pbib/conf $ENV{HOME}/.pbib $ENV{HOME}
Can be a comma separated list.
if $PBIBPATH is undefined, it defaults to /etc/pbib/styles,/etc/pbib/conf,/etc/pbib,/etc
$APPDATA is supported for Windows XP. If set, pbib searches $ENV{APPDATA}/PBib/styles $ENV{APPDATA}/PBib/conf $ENV{APPDATA}/PBib
if $PBIBDIR is undefined, it defaults to the directory pbib resides in (as detected by FindBin).
Perl's include path @INC is searched for all subdirectories PBib/styles and PBib/conf. This is where the an installed PBib finds all the default configuration.
Note: by using all these places for every config file, it is possible for each user to overwrite the site's configuration if necessary. Use with care!
Return an hash with all merged options entries. This also traverses sub-entry hashs.
Parameters that are no hash refs are ignored. Duplicate keys will be overwritten depending on the order of parameters.
Peter Tandler <pbib@tandlers.de>
Module PBib::PBib
$Log: Config.pm,v $ Revision 1.7 2003/06/16 09:12:28 tandler use default.pbib that contains config that was previously directly in the perl source
Revision 1.6 2003/06/13 16:11:09 tandler moved default local.pbib to "conf" folder
Revision 1.5 2003/04/16 15:06:09 tandler adapted to support search path for config files in patched Config::General
Revision 1.4 2003/04/14 09:46:12 ptandler new module ConfigFile that encapsulates Config::General
Revision 1.3 2003/02/20 09:26:41 ptandler added dirs to look for config files: - $ENV{PBIBDIR} (if set instead of $Bin), - $ENV{PBIBPATH} or /etc/pbib - $ENV{PBIBSTYLES} - $ENV{PBIBCONFIG}
Revision 1.2 2003/01/14 11:08:15 ptandler new config
Revision 1.1 2002/11/11 12:00:51 peter early stage ...
To install Biblio::BP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Biblio::BP
CPAN shell
perl -MCPAN -e shell install Biblio::BP
For more information on module installation, please visit the detailed CPAN module installation guide.