C. Chad Wallace wrote:
> At 7:05 PM on 14 May 2008, Robert Hicks wrote:
>
>> Because I am building 2 types of emails...I have 2 $template->process
>> commands and because it is in a loop and I have 5 users, I get five
>> error message when a template is incorrect.
>>
>> What I would like to do is catch the errors and only pass the unique
>> ones to STDERR.
>>
>> I am not sure if that is enough to go on.
>
> How about: instead of calling die, you save the error info in a hash,
> and then at the end of the loop, "warn" the unique ones.
>
>
I am not sure how to do that. Would I:
my %error_hash = ();
[ HTML ]
$template->process( code ) || $error_hash{ 'key' } = $template->error;
[ TEXT ]
$template->process( code ) || $error_hash{ 'key' } = $template->error;
Then later find the unique keys in that hash?
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates