December 2002
Intermediate to advanced
496 pages
9h 40m
English
In addition to the methods discussed previously, CGI.pm has functions for most of the commonly used HTML tags, including headings (h1(), h2(), h3(), etc.), paragraph breaks (p()), lists (li(), dl(), ul(), dd(), etc.), and text-formatting commands (i(), em(), blockquote()). See the CGI.pm documentation for details of all the shortcuts available.
Using these shortcuts is as straightforward as the previous example. Printing a heading:
<H1>Welcome to www.opensourcewebbook.com</H1>
becomes:
$server_name = `/bin/hostname`;
print h1("Welcome to $server_name") An HTML paragraph, <P>, is formatted as print p(); (no arguments), while
print p(´This is a new paragraph´);
is equivalent to this: ...
Read now
Unlock full access