[Templates] problems with %ENV when using TT from cron?

Josh Rosenbaum josh at infogears.com
Tue Jan 29 22:18:12 GMT 2008


David Martin wrote:
> Hi Josh,
> 
> When your mail arrived I was trying the call like so
> 
>                 $tt->process( '/www/foo/bar/baz/process_response.tt2', {
>                         post_data  => $post_data,
>                         env => '\%ENV',
>                         context => 'email',
>                         confirm_key => $person->cs_code,
>                         print_mailings => \@print_mailings
>                 }, \$response ) || die $tt->error;
> 
> 
> Can I call process with the full path?  It succeeded from the command line
> so I am guessing I can...
> 
> When you say to add the path to INCLUDE_PATH do you mean push it to @INC? Or
> is that a TT config?  Or?

I believe you can call process with the full path as long as you allow absolute paths when processing. That's usually a bad idea, though, since it's a security concern. See the absolute config option:
http://template-toolkit.org/docs/manual/Config.html#section_ABSOLUTE

The INCLUDE_PATH key is a TT config option:
http://template-toolkit.org/docs/manual/Config.html#section_INCLUDE_PATH

-- Josh



More information about the templates mailing list