in reply to Can I code perl inside HTML?

Embperl, which is available here at CPAN, describes itself as being a "Perl extension for embedding Perl code in HTML documents."

Templating modules such as HTML::Template, on the other hand, can be the functional equivalent of embedding Perl inside HTML.The documentation for HTML::Template by Sam Tregar says that often a module like Embperl is overkill for the problem at hand. In some cases one only needs to embed certain Perl constructs such as loops into HTML. HTML::Template seems to provide a lower overhead way to do that, although it embeds special markup rather than Perl itself into the HTML.

I have not yet started to use HTML::Template, and I do have one reservation about starting to. Apparently it is quite limited compared to yet other tools out there, including something called the (HTML?) Toolkit. Indeed, someone on Chatterbox today told me that comparing HTML::Template to the "Toolkit" is like comparing Palm Beach Punch-Card Voting Machines to real ones.

On the other hand, my cheap-o ISP won't let me install modules directly on the server using Makefile.PL, so I want something that I can copy into my CGI-bin by hand. Anything too complicated, such as HTML-Mason, is just too much work to manually install file-by-file and directory by directory.

I am hoping that something simpler like HTML::Template will fill the bill, and be superior to rolling my own templating tool which is essentially what I do now.

Replies are listed 'Best First'.
Look Seriously at EmbPerl
by Maclir (Curate) on Feb 02, 2001 at 02:04 UTC
    I would have to say that EmbPerl is a very easy way to go. You can take existing "pure" HTML, and add perl code to it. Plus, it is build on our good friend CGI.pm

    There is a little bit of effort in setting it up - and you will need root access to the server, to install the various modules and make the changes to your apache configuration files.