Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Conclusion

July 12, 1999

Generating live HTML content on-the-fly with Perl and the CGI module is easy. The challenges arise when you need that live content to be part of a larger, more complex web page, rather than simply standing on its own. Generating Web pages in Perl "from scratch", by printing pure HTML to the browser is intellectually simple but laborious and unfeasible for complex pages.

The CGI.pm Perl module provides methods which ease generating sections HTML code, especially forms. But building large Web pages even with these methods is still a cumbersome process. Typically, the live content you wish to generate only occupies a portion of the page, where the rest of the design is a static template.

The ideal solution, then, is to create the template for the page outside of Perl, with an HTML authoring tool of your choice. By using placeholders such as text or HTML comment tags inside the template page you can mark spots where live content will be substituted on-the-fly.

You can then write a Perl script which reads in the HTML template file, generates the live content, and uses regular expression substitutions to generate a "new" page, a combination of the HTML template with the live content.

Live Example

The Smallville Gazette

Tantalizing Templates: Build-a-Pizza Meets the Smallville Gazette
The Perl You Need to Know
The Perl You Need to Know: Part 5 "Processing and Parsing Web Pages"


Up to => Home / Authoring / Languages / Perl / PerlfortheWeb




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers