To add attributes to an HTML tag, simply pass a reference to an associative array as the first argument. The keys and values of the associative array become the names and values of the attributes. For example, here's how to generate an anchor link: use CGI qw/:standard/; print a({-href=>"bad_art.html"},"Jump to the silly exhibit"); Jump to the silly exhibit You may dispense with the dashes in front of the attribute names if you prefer: print img {src=>'fred.gif',align=>'LEFT'}; 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 has a border with . The syntax for this is an argument that 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 attribute argument was the same as providing undef. However, this has changed in order to accomodate those who want to create tags of the form . The difference is shown in this table: