My post is based out of curiosity.
There are three camps (at least):
- Those that hard code their html inline in their perl.
- Those that use CGI.pm to generate their html.
- Those that use a templating system to fill values into an existing html template.
All three choices have their benefits. They also each have downsides. These choices all cover a scale that has raw execution speed on one end and good design (separation of content) on the other end. Since the HTML generation aspects of CGI.pm fall in the middle of this scale, I am always interested to know what factors are driving the decision to use CGI.pm over a templating system or just raw html.
So that was a long way to ask: why have you chosen to use CGI.pm over either raw html or a templating system.
If the answer is "I'm not sure" then a would suggest using a templating system - even if it means that the html template is inline as a variable in the code.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.