in reply to Template Toolkit -- looking for files in all the wrong places.

Open the file yourself first and then hand it the filehandle.
#untested open TFH, "main.html" or die "Can't open main.html cause $!"; my $template = Template->new() or die "new Template error $!"; $template->process(\*TFH) or die $tt->error(), "\n"; ## or if you hate glob references maybe use IO::File; my $tfh = new IO::File; open($tfh, "main.html") or die "Can't open main.html cause $!"; my $template = Template->new() or die "new Template error $!"; $template->process($tfh) or die $tt->error(), "\n";

The power of Template is the power of perl, there is more than one way to do things hidden in there. Very cool module. Keep trying with it.

Also, I'd recommend against putting the templates themselves in a subdirectory of your CGIs. That seems a bit insecure to me. Make a template dir at the same level as the CGIs and the docroot and save yourself some worry.

--
$you = new YOU;
honk() if $you->love(perl)

  • Comment on Re: Template Toolkit -- looking for files in all the wrong places.
  • Download Code