Skip to main content
Embedding Perl with HTML::EP

At various times in my short programming carreer, I have programmed in ASP, JSP, PHP and Perl. The first 3 of those languages had nice features which would allow dropping language code into HTML documents. So if I needed some small pieces of dynamic information such as a date or a name to go into an otherwise largely static HTML document I could encapsulate the code in certain tags, submit it to the webserver and have it return the static + dynamic information. There was minimal performance effect and as a programmer I had freedom to choose where to place the code for extracting the dynamic output.

Until now however, I never did this in Perl/CGI. Whenever I needed dynamic information in Perl I would have to write a script for it. This was a huge waste for such HTML output-pages which were for the most part static. I had to write a script and print all of the static content in one or more print statements.

Apparently Perl language add-ons/modules have been available which allow embedding Perl into HTML pages for quite some time. I discovered one such today - the HTML::EP module. This allows special tags for letting the server know how they should be handled (ex. pass on to Apache mod-perl).

More documentation about HTML::EP at

A nice feature HTML::EP has is the concept of multiple tag types which cater to special functions such as for example sending email.

<ep-mail subject="Howdy!" from="" to="">
Hello, Bill, old chap. How are you?

Yours sincerely,

I think this construction is superior to the other languages such as JSP, PHP or ASP as it allows for purpose specific calls, rather than having a single call for all purposes.