http://www.perlmonks.org?node_id=961416

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

Hi,

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";