In addition to the CGI docs, check this node. the issue with the way CGI generates html is that it uses referenced and anonymous data types, which tend to confuse the newbies (i should know, i'd been one for a very long time).
__________ Systems development is like banging your head against a wall...
It's usually very painful, but if you're persistent, you'll get through it.