quoted from:
http://search.cpan.org/src/LDS/CGI.pm-3.25/cgi_docs.html
(stale; no updating since Feb 2005, but perhaps helpful anyway:
To add attributes to an HTML tag, simply pass a reference to an associ
+ative array as the first argument. The keys and values of the associa
+tive array become the names and values of the attributes. For example
+, here's how to generate an <A> anchor link:
use CGI qw/:standard/;
print a({-href=>"bad_art.html"},"Jump to the silly exhibit");
<A HREF="bad_art.html">Jump to the silly exhibit</A>
You may dispense with the dashes in front of the attribute names if yo
+u prefer:
print img {src=>'fred.gif',align=>'LEFT'};
<IMG ALIGN="LEFT" SRC="fred.gif">
Sometimes an HTML tag attribute has no argument. For example, ordered
+lists can be marked as COMPACT, or you wish to specify that a table h
+as a border with <TABLE BORDER>. The syntax for this is an argument t
+hat that points to an undef string:
print ol({compact=>undef},li('one'),li('two'),li('three'));
Prior to CGI.pm version 2.41, providing an empty ('') string as an att
+ribute argument was the same as providing undef. However, this has ch
+anged in order to accomodate those who want to create tags of the for
+m <IMG ALT="">. The difference is shown in this table:
| CODE | RESULT |
| img({alt=>undef}) | ![]() |
| img({alt=>''}) | <IMT ALT=""> |
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.