Pinwheel::View::ERB - Simple templating based on Ruby's erb syntax
my $src = 'Hello <%= "world" %>'; $template = Pinwheel::View::ERB::parse_template($src); $template = Pinwheel::View::ERB::parse_template($src, $name); $result = &$template($locals, $globals, $fns);
Pinwheel::View::ERB implements a simple subset of Ruby's erb templating syntax (as used in .rhtml templates in Ruby on Rails).
parse_template(CONTENT)
parse_template(CONTENT, NAME)
Parse the string in CONTENT as a template, optionally associating NAME with the result for use in error messages. The return value is a function reference that can be called to generate the output.
&$template(LOCALS, GLOBALS, FNS)
Render the template (the result of parse_template) and return the result as a string. The LOCALS and GLOBALS hashes contain the local and global namespaces, and may be updated by the template. The FNS hash specifies which functions should be exposed to the template.
parse_template
A&M Network Publishing <DLAMNetPub@bbc.co.uk>
To install Pinwheel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pinwheel
CPAN shell
perl -MCPAN -e shell install Pinwheel
For more information on module installation, please visit the detailed CPAN module installation guide.