Mixing HTML, even in its CGI-function-conceiled form, with code in this way is almost never a good idea, though. I've found that even in cases of small scripts where I started out like this, I'd've been better served to opt for a template(ish) solution right off the bat. On the other hand, ever since I got into the habit of doing that, I've never found myself wishing I hadn't put forth the effort to separate out the HTML. The reason is scalability - templates are easier to grow complexity into as you go, which is important CGI scripts tend not to be one-off, throw-away solutions. Rather, even in simple ones tend to hang around for significant periods of time, and I've found that nearly every single one of them eventually grew. If not by much, then still enough so to make matters of initial organization important down the road.
Makeshifts last the longest.
-
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.
|