> > > As soon as I set CACHE_SIZE to 0, all my TT CGIs now give me:  Can't
> call
> > > method "process" on unblessed reference at
> > > /usr/lib/perl5/site_perl/5.005/Template/Context.pm line 286.
> > >
> > > If I set CACHE_SIZE to anything other than 0, I don't have this problem.
>
> I remember this bug.  It was fixed somewhere in the 2.0.x series.  I suggest
> upgrading to the latest release.

Running 2.05a (and restarting apache just for kicks, mod_perl isn't
configured to affect these scripts) had no effect.  I wrote a simple
script to test, and it worked.  I played around a bit and narrowed it down
to the PRE_PROCESS and POST_PROCESS commands.

This script dies as above:

#!/usr/bin/perl -wT
use strict;
use Template;
use CGI;
use CGI::Carp;

my $template = Template->new(
  CACHE_SIZE => 0,
  INCLUDE_PATH  =>  [ '/usr/local/apache/content', ],
  PRE_PROCESS => 'CrashHeader.html',
) || die $Template::ERROR;

my $q = new CGI;
print $q->header;
my $faketemplate = q{ This is a test:  [% Foo %]};
$template->process(\$faketemplate, {Foo=>'Bar'}) || die
$template->error();

(I've run it from the command line and get the same error, so it isn't an
apache problem)

[brs900@www new]$ ./crash.cgi
Content-Type: text/html; charset=ISO-8859-1

[Wed Sep 19 10:59:55 2001] crash.cgi: Can't call method "process" on
unblessed reference at
/usr/lib/perl5/site_perl/5.005/i386-linux/Template/Context.pm line 286.

If I remove any PRE_PROCESS and POST_PROCESS commands, it runs fine.   The
files pointed at don't appear to matter (my 'CrashHeader.html' file simply
says "test").  Likewise, changing CACHE_SIZE to anything other than 0 also
has it work fine.

Advice?  Thanks in advance!








Reply via email to