XML::Template::Config - Configuration module for XML::Template modules.
use base qw(XML::Template::Base); use XML::Template::Base;
This module is the XML::Template configuration module. It contains the default values of many configuration variables used by many XML::Template modules.
Configuration variables and their default values are defined at the top of Config.pm. The variable name must be all uppercase. Variable values are actually array reference tuples. The first element is the type of configuration variable (VAR or PACKAGE), and the second element is the value. For instance,
Config.pm
VAR
PACKAGE
$CONFIGFILE = [VAR, '/usr/local/xml-template/xml-template.conf']; $PROCESS = [PACKAGE, 'XML::Template::Process'];
A configuration variable value is obtained by a calls to an XML::Template::Config subroutine that has the same name as the configuration variable but is lowercase. For instance, to get the values of the configuration variables above,
XML::Template::Config
my $configfile = XML::Template::Config->configfile; my $process = XML::Template::Config->process (%params);
For configuration variables of the type VAR, the value is simply returned. If the type is PACKAGE, the module given by the configuration variable value is required, and an object is instantiated and returned. Parameters passed to the XML::Template::Config subroutine are passed to the module constructor.
my $config = XML::Template::Config->config ($configfile);
This method returns a hash containing the configuration information in the XML config file. The first call to config loads the config file and stores it in the package global variable $CONFIG. Subsequent calls to config will simply return $CONFIG.
config
$CONFIG
An optional parameter may be given naming the config file. If no parameter is given, the config file is named by the configuration variable $CONFIGFILE.
$CONFIGFILE
See the documentation in xml-template.conf for information on the format and contents of the config file.
xml-template.conf
XML::Template::Config->load ($module) || return $self->error (XML::Template::Config->error);
This method requires the module, $module.
$module
Jonathan Waxman jowaxman@bbl.med.upenn.edu
Copyright (c) 2002 Jonathan A. Waxman All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install XML::Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Template
CPAN shell
perl -MCPAN -e shell install XML::Template
For more information on module installation, please visit the detailed CPAN module installation guide.