In Template Toolkit in Perl, I'm getting two errors instead of one.
local $SIG{__DIE__} = \&fatal;
print template('home.htssdfgsml');
sub template {
# --------------------------------------------------------------
#
my ($file, $vars) = @_;
my ($output, $template);
my $config = {
INCLUDE_PATH => $TEMPLATE_PATH
};
$template = Template->new($config);
$template->process($file, $vars, \$output) || die Template->error;
return $output;
}
sub fatal {
# --------------------------------------------------------------
#
my $msg = shift;
print_header();
print "<p><font face='Tahoma,Arial,Helvetica' size=2>A fatal error has occured:</font></p><blockquote><pre>$msg</pre></blockquote></font></p>\n";
}
and I get this output with two errors instead of one:
A fatal error has occured:
file error - home.htssssml: not found
A fatal error has occured:
file error - home.htssssml: not found at /var/path/path/file.pm line
29.
Any suggestions on how to just print one error?