I'm trying to use the Tenjin module but it fails because it can't find the template file but it exists. I've added some debug statements into the module and it's not passing
return $filepath if (-f $filepath);
even when $filepath is correct. I've tried in a standalone script and it works fine but when I copy it to the mod_perl script it fails. Any ideas?
$filepath is a full absolute path: /something/another/dir/2/filename.plhtml
This is the function form the module. Notice my "Debug"...it prints the correct path to the file which is 777 but it never prints YES.
sub find_template_file {
my ($this, $filename) = @_;
my $path = $this->{path};
if ($path) {
my $sep = $^O eq 'MSWin32' ? '\\\\' : '/';
foreach my $dirname (@$path) {
my $filepath = $dirname . $sep . $filename;
print STDERR "--$filepath--\n";
if (-f $filepath){
print STDERR "--- YES ---\n\n";
}
return $filepath if (-f $filepath);
}
} else {
return $filename if (-f $filename);
}
my $s = $path ? ("['" . join("','", @$path) . "']") : '[]';
die "Tenjin::Engine: $filename not found (path=$s).";
}
Fails with
Tenjin::Engine: index.plhtml not found (path=['/var/2.0/templates/search']). at /usr/lib/perl5/site_perl/5.8.8/Tenjin/Engine.pm line 56.\n