Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
When I try to run this it says#!/usr/bin/perl -w use strict; use Template; use CGI qw/:standard/; use CGI::Carp qw/fatalsToBrowser/; $| = 1; print header; my $file = '/templates/userinfo.html'; my $vars = { 'version' => 3.14, 'days' => [ qw( mon tue wed thu fri sat sun ) ], 'worklist' => \&get_user_projects, 'cgi' => CGI->new(), 'me' => { 'id' => 'abw', 'name' => 'Andy Wardley', }, }; sub get_user_projects { my $user = shift; my @projects = qq/ Foo Bar Baz /; return \@projects; } my $template = Template->new({ INCLUDE_PATH => '/templates/includes', PRE_PROCESS => 'config', }); $template->process($file, $vars) # This is line 33 || die $template->error();
When I change the file to a relative path, it saysfile error - /templates/userinfo.html: absolute paths are not allowed +(set ABSOLUTE option) at C:\Inetpub\wwwroot\cgi-bin\userinfo.cgi line 33.
Why does it say that I can't use absolute or relative paths? I didn't know there were any other types. Grr...file error - ../templates/userinfo.html: relative paths are not allowe +d (set RELATIVE option) at C:\Inetpub\wwwroot\cgi-bin\userinfo.cgi line 32.
This is the file structure, if it matters.
wwwroot ---- cgi-bin
|
|
\-- templates ---- includes
I have userinfo.html in the templates folder and the header and footer files in the includes folder.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Template toolkit
by chipmunk (Parson) on May 11, 2001 at 20:08 UTC | |
by Anonymous Monk on May 11, 2001 at 20:18 UTC | |
|
Re: Using Template toolkit
by Masem (Monsignor) on May 11, 2001 at 20:01 UTC | |
by Anonymous Monk on May 11, 2001 at 20:14 UTC | |
by Masem (Monsignor) on May 11, 2001 at 20:34 UTC | |
|
Re: Using Template toolkit
by Anonymous Monk on May 11, 2001 at 20:37 UTC |