Chapter 13. SEPARATING HTML CODE FROM PERL CODE

Understanding the Benefits of Separating HTML from Perl

By separating HTML from Perl, you can create HTML-only templates solely for displaying syntax, and leave Perl to handle the Web site logic. If you continue to embed HTML in Perl for complex HTML code, such as a table, understanding how that table is constructed could become very difficult. This is especially true if your table is generated from an external source, if the table has a syntax error, or if someone new is looking at the code. Suddenly, if the table needs to be changed, more effort is spent to understand how the table is built than it takes to apply the change. You can avoid this extra work if you separate the HTML layout from the ...

Get Perl and Apache: Your visual blueprint for developing dynamic Web content now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.