You could just always end the line with a comma. That often leads to code that is easier to maintain anyway.
But the comma is required (whether at the end of the line or not) if it is needed to separate two items. So you don't need a comma before a closing ) or }, for example, but you can put one there if it would be convient (especially if future changes to the code might lead you to add additional items after that line).
If you do include a "trailing" comma, then you should also move the closing bracket to the next line:
I also think your indentation could be more regular. (:table( { -bgcolor => "#000000", -border => "0", -cellpadding => "2", -cellspacing => "1", -style => "font: 10pt;", }, Tr( { -style => "background-color:#CCCCCC" }, td( strong( "User Name:" ) ), td( input( { -maxlength => "30", -name => "username", -size => "30", -type => "text", } ) ), }, ), # end Tr );
Note how in my code above, you can insert, delete or rearrange items in any of the lists by inserting, deleting, or rearranging lines without having to adjust opening or closing brackets or commas. That is usually a good thing.
- tye (but my friends call me "Tye")In reply to (tye)Re: ??Using Commas in CGI qw/:standard/ to make HTML??
by tye
in thread ??Using Commas in CGI qw/:standard/ to make HTML??
by jerrygarciuh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |