On Fri, Apr 22, 2011 at 10:41 PM, <sono...@fannullone.us> wrote: > I realize that this list may not be the best, or even most > appropriate, place to ask this question, but I'm just so curious that I'm > losing sleep over it! =;) > > What is the best way to embed perl in an HTML file that is _not_ > located under the cgi-bin directory? I started learning PHP for this very > reason, but I keep coming back to Perl. I've read some about Template > Toolkit and others, but what I'm still confused over is if these templates > _must_ be located in cgi-bin or can you embed code anywhere on your site? > > If possible, I would like to be able to embed perl, placeholders, > templates, whatever, anywhere on my site. Perhaps I'm working under the > wrong impression, but for some reason I'm thinking you can't. Hopefully I'm > wrong. Any help in pointing me in the right direction will be greatly > appreciated. > > Thanks, > Marc
I hope i am not wrong but you script needs to be in the cgi-bin dir or where ever ScriptAlias path you have mentioned and Template Toolkit will achieve your goal my $tt = Template->new( INCLUDE_PATH => "/var/template" ) || die "template process failed:$!"; %tag = ( 'result' => $somevairable ); $tt->process("form.tmpl",\%tag) || die $tt->error(); your /var/template path holds all your teml files and it has to be chown to apache:apache if the web server is Apache of course . -- Regards Agnello D'souza -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/