Ovid has asked for the wisdom of the Perl Monks concerning the following question:
Let's say I have the following Template Tookit template:
<html> <head><title>[% title %]</title></head> <body>[% INCLUDE "$site/$body" %]</body> </html>
If "$site/$body" is not found, I currently have a DEFAULT template set in the constructor:
my $template = Template->new( { INCLUDE_PATH => $some_include_path, DEFAULT => $some_default, PLUGIN_BASE => 'Onsite::Template::Plugin', OUTPUT => \$self->{_output} } );
The problem I have is that I want need to be automatically notified when a template fails to load (which is easy if I point the default template at a plugin), but I would like to know which template failed to load. In other words, with the above code, how would I pass the value of "$site/$body" to the $some_default template?
The only thing I've come up with is including the Data::Dumpered output of the Template object in the email, but that would be about as popular as meat-flavored ice cream.
And yes, this has already been posted to the Template mailing list :)
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Which template failed to load?
by merlyn (Sage) on Aug 13, 2002 at 04:31 UTC | |
|
Re: Which template failed to load?
by adrianh (Chancellor) on Aug 24, 2002 at 14:59 UTC | |
|
Re: Which template failed to load?
by BUU (Prior) on Aug 13, 2002 at 01:29 UTC |