homepage Welcome to WebmasterWorld Guest from 54.205.144.54
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

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




msg:440980
 4:07 am on Jul 28, 2005 (gmt 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

 

WWMike




msg:440981
 4:22 am on Jul 28, 2005 (gmt 0)

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

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

moltar




msg:440982
 5:10 am on Jul 28, 2005 (gmt 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.

Custodian




msg:440983
 2:42 pm on Jul 28, 2005 (gmt 0)

Thanks Again Moltar -
I'm headed to CPAN to get another rollof ductape :)

SeanW




msg:440984
 2:47 pm on Jul 28, 2005 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved