OK, I am coming from a PHP background (I can already hear mumblings around ;)) and find CGI.pm (or any other HTML done in a similar way for that matter) unintuitive and ugly. Whenever I am doing some web-work I use templates for HTML. That way you can have a very clean hand-crafted HTML and no ugly print statements. Most of the time only a few things on a page are generated dynamicly, so it is very easy to use things like this:
use HTML::Template;
# ... first send header, update counters, whatever ...
# then comes HTML rendering phase:
my $template = HTML::Template->new('template.html');
# set some parameter
$template->param('counter', $counter);
# print it all
print $template->output();
It really separates all the business logic from display, so you can concentrate on interface with databse or whatever while leaving the HTML for a template. Well, at least I like it ;)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|