| Apache2::WebApp::Helper - Base class for command-line script functionality |
Apache2::WebApp::Helper - Base class for command-line script functionality
use Apache2::WebApp::Helper;
my $obj = Apache2::WebApp::Helper->new;
Base class module that implements a constructor and provides helper script functionality for writing template output to a file.
Set the template object attributes.
$obj->set_vars(\%vars);
Write the template output to a file.
$obj->write_file( $file, $output );
Print errors/exceptions to STDOUT and exit.
$self->error($mesg);
use Apache2::WebApp::Helper;
my $obj = Apache2::WebApp::Helper->new;
$obj->set_vars( { foo => 'bar', baz => qw( bucket1 bucket2 bucket3 ), qux => qw{ key1 => 'value1', key2 => 'value2', ... }, ... } );
# program continues...
$obj->write_file('infile.tt','/path/to/outfile.txt');
[% foo %]
[% FOREACH bucket = bar %]
[% bucket %]
[% END %]
[% qux.key1 %] [% qux.key2 %]
the Apache2::WebApp manpage, the Apache2::WebApp::AppConfig manpage, the Apache2::WebApp::Template manpage
Marc S. Brooks, <mbrooks@cpan.org> http://mbrooks.info
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
| Apache2::WebApp::Helper - Base class for command-line script functionality |