Hi jdrago_999,
Thanks for the reply.
Yes, I did try the sample code and that all works fine. I am happy that my mod_perl/perl/Apache are all installed ok.
My site works fine using HTML::Template. When I switch to use Template I get the error:
[Wed Apr 01 09:28:54 2009] [crit] (22)Invalid argument: Parent: Failed
+ to create the child process.
[Wed Apr 01 09:28:54 2009] [crit] (OS 6)The handle is invalid. : mast
+er_main: create child process failed. Exiting.
[Wed Apr 01 09:28:54 2009] [notice] Parent: Forcing termination of chi
+ld process 2670888
Everything works fine from the command-line, it just crashes when I run through apache.
I have set up my site so that the template engine is swappable and am using HTML::Template::Filter::TT2; so that the templates are exactly the same between HTML::Template and Template::Toolkit
Here is the working Template code for HTML::Template
sub Render
{
my $proto = shift;
my ($params, $data, $template, $base_template_dir) = @_;
my $engine = HTML::Template::Expr->new(filter => \&ht_tt2_filter,
filename => $base_templat
+e_dir.'/'.$template,
die_on_bad_params=>0,
encoding => ':utf8');
$engine->param($params);
$engine->param($data);
print $engine->output;
}
Here is the corresponding code for Template::Toolkit which crashes
sub Render
{
my $proto = shift;
my ($params, $data, $template, $base_template_dir) = @_;
my $tt = Template->new({INCLUDE_PATH => $base_template_dir,
INTERPOLATE => 1})
|| croak("$Template::ERROR\n");
$tt->process($template, { params => $params, data => $data } );
}
and are called are called via
$TEMPLATE_ENGINE->Render(@_, $TEMPLATE_DIR);
where $TEMPLATE_ENGINE is the appropriate prototype.
I'd appreciate any help you can give me.
Thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.