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

David Martin designs at nolaflash.com
Tue Jan 29 20:31:41 GMT 2008


Hello,

 

I have an inherited script that sends an email using TT to assemble an
email.  The template syntax compiles fine, and the script actually succeeds
without issue from the commandline.  However when cron runs the script the
$response variable is empty.

 

I have verified that the only variable that is altered in cron vs cmd line
is %ENV so I making an educated guess that this is somehow causing $response
to be empty.

 

                my $response = '';

                $tt->process( 'process_response.tt2', {

                        data  => $data,

                        env => \%ENV,

                        context => 'email'

                }, \$response );

 

I have captured the contents of %ENV from both environments and pasted below
my sig.  Anyone see what may be causing issues?  Any advice as to how to
fix?

 

Is this too little information?

 

David Martin
 <http://www.nolaflash.com/> NolaFlash.com
Web Design, Programming and Hosting

4600 S Tonti St
NO LA 70125
504.583.3755

 <http://www.nolaflash.com/>  

 

## CMD LINE %ENV ##

$VAR1 = 'HOME';

$VAR2 = '/home/david';

$VAR3 = 'SSH_CLIENT';

$VAR4 = 'ip stuff here';

$VAR5 = 'SSH_CONNECTION';

$VAR6 = 'more ip stuff';

$VAR7 = 'BLOCKSIZE';

$VAR8 = 'K';

$VAR9 = 'EDITOR';

$VAR10 = 'pico';

$VAR11 = 'MAIL';

$VAR12 = '/var/mail/david';

$VAR13 = 'PWD';

$VAR14 = '/home/david';

$VAR15 = 'USER';

$VAR16 = 'david';

$VAR17 = 'LOGNAME';

$VAR18 = 'david';

$VAR19 = 'SHLVL';

$VAR20 = '1';

$VAR21 = '_';

$VAR22 = '/usr/bin/perl';

$VAR23 = 'ENV';

$VAR24 = '/home/david/.shrc';

$VAR25 = 'PATH';

$VAR26 =
'/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/us
r/X11R6/bin:/home/david/bin';

$VAR27 = 'FTP_PASSIVE_MODE';

$VAR28 = 'YES';

$VAR29 = 'SHELL';

$VAR30 = '/usr/local/bin/bash';

$VAR31 = 'TERM';

$VAR32 = 'vt100';

$VAR33 = 'PAGER';

$VAR34 = 'more';

$VAR35 = 'SSH_TTY';

$VAR36 = '/dev/ttyp3';

 

## CRON %ENV ##

$VAR1 = 'HOME';

$VAR2 = '/home/david';

$VAR3 = 'LOGNAME';

$VAR4 = 'david';

$VAR5 = 'SHELL';

$VAR6 = '/bin/sh';

$VAR7 = 'USER';

$VAR8 = 'david';

$VAR9 = 'PATH';

$VAR10 = '/usr/bin:/bin';

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.template-toolkit.org/pipermail/templates/attachments/20080129/69c31e87/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 1754 bytes
Desc: not available
Url : http://mail.template-toolkit.org/pipermail/templates/attachments/20080129/69c31e87/attachment.jpeg 


More information about the templates mailing list