in reply to Catching Template Toolkit Errors

In cgi, a message to STDERR will generally show up in the httpd's error log. For non-fatal errors, Perl's warn will do the job. For fatal ones, die.

You can keep error messages in a variable by opening STDERR to a reference to that variable. Something like:

{ my $errors; open local(*STDERR), '>>', \$errors or die $!; # do stuff, can call external functions that warn or die if ($errors) { print error_template($errors); # however you do that exit 0; # or non-zero if we want to tell the server we failed } # maybe do more stuff - success branch }

After Compline,
Zaxo