Config::Generator::Template - Config::Generator template support
This module eases configuration file generation by providing template support. A template is a file with markup. Given a high-level configuration, the template can be processed and transformed into a low-level configuration file.
The template commands are enclosed within "<{" and "}>". If PATH represents a path in the high-level configuration:
"<{PATH}>" will be replaced by the value of PATH
"<{open()}>" will be replaced by "<{"
"<{close()}>" will be replaced by "}>"
"<{if(PATH)}>xxx<{endif(PATH)}>" will be replaced by "xxx" if PATH is true or "" otherwise (this is done using Perl's conditional testing)
"<{ifnot(PATH)}>xxx<{endif(PATH)}>" is the same as "if()" but negated
"<{if_true(PATH)}>xxx<{endif(PATH)}>" is the same as "if()" but tested using Config::Validator's is_true()
"<{if_false(PATH)}>xxx<{endif(PATH)}>" is the same as "if()" but tested using Config::Validator's is_false()
"<{ifdef(PATH)}>xxx<{endif(PATH)}>" will be replaced by "xxx" if PATH is defined (i.e. set) or "" otherwise
"<{ifndef(PATH)}>xxx<{endif(PATH)}>" is the same as "ifdef()" but negated
This module provides the following functions (none of them being exported by default):
declare one or more template names so that they can be customized using the /Template schema
/Template
read and process the named template, using the given hash as well as the high-level configuration
process the given template string using the given hashes
return the contents of the named template (unprocessed)
Lionel Cons http://cern.ch/lionel.cons
Copyright (C) CERN 2013-2016
To install Config::Generator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Generator
CPAN shell
perl -MCPAN -e shell install Config::Generator
For more information on module installation, please visit the detailed CPAN module installation guide.