On 04/22/2011 10:11 AM, 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.

I've had similar experiences with PHP.


Perl is extremely flexible. Depending upon your particulars, you can put Perl scripts under cgi-bin/, you can put Perl scripts under public_html/, you can invoke Perl scripts from within web page source files, you can put Perl code inside web page source files, you can put a Perl interpreter and handlers inside your web server, you can write a Perl web server, and other permutations that I've forgotten or haven't tried yet. The upside of TIMTOWTDI [1] is that there are lots of choices. The downside is that finding the right set of choices for a particular person and project is a non-trivial undertaking.


This article has good background information and got me thinking in the right direction. Unfortunately, it is getting dated and doesn't cover Catalyst, "Modern Perl", etc.:

    http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html


Over the years, I've studied, attempted, and/or applied many Perl web technologies with varying degrees of success. I'm currently attempting to build a Perl CMS using LWP to replace Drupal 6 on my personal/ community web site [2]. My fall-back choice is Mason (version 1.x), which might work for you. Mason is mature, widely used, well understood, and there's good documentation available; notably:

    http://www.masonhq.com/?OreillyBook


HTH,

David


References:

[1] http://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it

[2] http://holgerdanske.com/

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to