[Thamesvalley-pm] generating HTML
Dave Cross
dave at dave.org.uk
Thu Oct 18 12:32:41 PDT 2007
Greg Matthews wrote:
> Well... I threatened this email so here goes...
>
> Is there a neater way of generating html than this:
>
> print INDEX " <tr>
> <td style=\"vertical-align: top;\">$host<br>
> </td>\n";
As Andy says, you should really look at using a templating system (I
know a _great_ book about the Template Toolkit). But if you want to
stick with print statements you should, at least, use more appropriate
quoting operators to avoid having to escape internal quotation marks.
print INDEX qq( <tr>
<td style="vertical-align: top;">$host<br>
</td>\n);
Another option is to use here-docs.
print INDEX <<END_OF_HTML
<tr>
<td style="vertical-align: top;">$host<br>
</td>
END_OF_HTML
Dave...
More information about the Thamesvalley-pm
mailing list