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


in reply to Template Toolkit Root Permission

The way that this runs only as root leads me to think that some of the directories you are using don't have read permissions for people other than root, making root the only one who can get any output from the shell. So just add read permissions for all in the directories and files used in your script.

Replies are listed 'Best First'.
Re^2: Template Toolkit Root Permission
by romy_mathew (Beadle) on Mar 24, 2012 at 17:24 UTC

    I could see this script actually is exectuing because it could print hello while exectuing the script but the template part not able to show its output you could see the script executing on

    http://182.18.173.61/cgi-bin/linen_tracking.pl

    I have given complete permission to all the directory

    For E.g if i comment the line #PRE_PROCESS => 'config', #PRE_PROCESS => 'variable', It give me complete output as
    hello <html> <head> </head> <body> <h1>romy</h1> </body> </html>
    else it give me output as only "hello"

      If you check the Template Toolkit manual, you'll notice:

      Multiple templates may be specified as a reference to a list. Each is processed in the order defined.

      my $template = Template->new({ PRE_PROCESS => [ 'config', 'header' ], POST_PROCESS => 'footer', };

      and

      Alternately, multiple template may be specified as a single string, delimited by ':'. This delimiter string can be changed via the DELIMITER option.

      my $template = Template->new({ PRE_PROCESS => 'config:header', POST_PROCESS => 'footer', };

      So, judging by your issue and the way that you have set multiple PRE_PROCESS templates, I think this will fix your problem.