romy_mathew has asked for the wisdom of the Perl Monks concerning the following question:
I am using Template Toolkit to seperate my html code with perl script, but I face problem when running the perl script on web browser or user other than root showing error "Failed to execute the template toolkit" But when i run as root in the command line I am getting the correct output
Can you suggest me a solution
Below is my script#!/usr/bin/perl -w use strict; use CGI qw(:standard); use Template; use 5.010; use Data::Dumper; print "Content-Type: text/html\n\n"; #$| = 1; #---------------------------------------------------------- # Define Varriables #---------------------------------------------------------- #..................................................................... +................... my $template = '/var/www/linen_tracking/home.html'; say "hello "; my $hell = "romy"; my $vars = { HELL => $hell, }; #..................................................................... +.................. #..................................................................... +................... # Template Presentation #..................................................................... +................... my $tt = Template->new ({ INCLUDE_PATH => [ '/var/www/e-commerce/template/src/', '/var/www/e-commerce/template/lib/', ], PRE_PROCESS => 'config', PRE_PROCESS => 'variable', ABSOLUTE => 1, RELATIVE => 1, }); $tt->process($template,$vars)|| die "Failed to execute the template $t +t->error() \n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Template Toolkit Root Permission
by bms (Monk) on Mar 24, 2012 at 16:10 UTC | |
by romy_mathew (Beadle) on Mar 24, 2012 at 17:24 UTC | |
by bms (Monk) on Mar 24, 2012 at 17:59 UTC | |
|
Re: Template Toolkit Root Permission
by mbethke (Hermit) on Mar 24, 2012 at 20:32 UTC |