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=""> |