Hi I'm new to TT, and it's being a real pain at the moment, the man page
is very general and the debugging doesn't really say very much.
Quick question:
if I do a:
<Perl>
use lib qw(/paths /paths);
</Perl>
Should this be enough to indicate to Apache::Template where it
should look in order to find the library path to the module which I have
specified under TT2PluginBase?
I'm guessing that our template is not able to find the Plugin module. Just
incase it isn't the lib that's the problem, i've attached my bits and
pieces below.
My problem is that the USE statement in my template appears to cause it
fail.
I'd be really grateful to anyone who might be able to shed some light on
this for me.
The relevant bits and pieces are included below.
Cheers,
Fiq
___________________________
The important bit of my conf:
<Perl>
use lib qw(/home/henry/projects/affiliates/lib/
/home/henry/projects/affiliates/lib/Apache);
</Perl>
PerlModule Apache::Template
PerlModule Partner::Affiliate_Contacts
PerlModule Apache::DBI
TT2IncludePath /home/henry/projects/affiliates/html/
TT2Interpolate Off
TT2Debug On
TT2Trim On
TT2PreChomp On
TT2PostChomp On
TT2PluginBase Partner
TT2EvalPerl On
TT2Error error
TT2LoadPerl On
TT2Params uri env params
<Location />
SetHandler perl-script
PerlInitHandler Apache::StatINC
PerlHandler Apache::Template
</Location>
The plugin constructor:
______________________________--
package Partner::TT::Affiliate_Contacts;
use lib qw(/home/henry/projects/affiliates/lib);
use strict;
use Partner::Affiliate_Contacts;
use base qw(Template::Plugin Partner::Affiliate_Contacts);
print STDERR "\n init of plugin \n";
sub new
{
my $pkg = shift;
my $ctxt = shift;
my $args = shift;
my $self = bless $args, $pkg;
## setup local constuctor
$self->init($args);
return $self;
}
sub load
{
my ($class, $context) = @_;
return $class; # returns 'MyPlugin'
}
1;
---------------------------------------------------
The line which uses this in my template:
[% USE affiliateSearch = Affiliate_Contacts('affiliateId'=affiliateId)
%]
My error:
[Tue Apr 9 16:53:55 2002] [error] access to
/home/henry/projects/affiliates/html/display.html failed for
192.168.10.185, reason: file error - error: not found