Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm just learning to use template toolkit and I keep getting error messages like this:

file error - main.tmpl: not found at C:\Inetpub\public\mainsite\www\ma +in\dispatch.cgi line 35.

Is there any way I can see the full path that template toolkit is trying to access? I've tried all sorts of ways of instantiating a new template object, but none of them seem to let me get to the right path.

my $template = Template->new( { INCLUDE_PATH => '..\admin\templates;..\main', ABSOLUTE => 1 } );

If I could just see the full path that template toolkit is searching, that would be great. Right now, the error message is not very helpful. Thanks.

jatzger

Replies are listed 'Best First'.
Re: Template Toolkit Path
by chromatic (Archbishop) on Aug 03, 2001 at 09:41 UTC
    You could probably get at it with something like:
    use Cwd; use File::Spec; print "In directory ->", File::Spec->catfile(cwd(), '..\admin\templates'), "<-\n";
    However, the problem may be that TT2 expects colon-delimited directories in INCLUDE_PATH. You can also pass an array reference, or set the DELIMITER option so it expects the semi-colon. Give that a whirl.