Welcome to WebmasterWorld Guest from 54.163.25.166

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

To embed or not?

What's the best way to embed Perl in HTML? Or should I not?

     
4:07 am on Jul 28, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:July 29, 2004
posts:80
votes: 0


I want to create HTML pages with small chungs of Perl.

To me it seems easier to Write the HTML and embed the Perl where I need it. After looking on CPAn, there seems to be several modules that will do the job.

Are there some modules better than others?

OR

Should I not embed at all and just use the functions in the CGI module to generate my pages?

Thanks again
Clueless Custodian

4:22 am on July 28, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:July 11, 2005
posts:66
votes: 0


One way is to enable SSI for your .html pages and call the .cgi as follows:

<!--#include virtual="/cgi-bin/randhtml.cgi" -->

5:10 am on July 28, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 18, 2003
posts:1925
votes: 0


If the chunks are really small I'd embed. HTML::Mason is very powerful and might be too much for something small, but I don't know your task. Amazon uses HTML::Mason. There is also Embperl which is lighter and might be better for something small.
2:42 pm on July 28, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:July 29, 2004
posts:80
votes: 0


Thanks Again Moltar -
I'm headed to CPAN to get another rollof ductape :)
2:47 pm on July 28, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 30, 2003
posts:428
votes: 0


HTML::Mason, Template::Toolkit, or HTML::Template will let you mix both. Mason is probably the better one if you want to mix Perl into HTML.

Sean