in reply to html->perl->c->perl...... work dang it

You can also use a here document to replace all those prints. You just tell it what you want to be printed plus it'll also interpolate variables (e.g. turn $dog_name into "Fido")

As an example, instead of
print " <HR>\n"; print " <TABLE border=0 width=100% bgcolor=\"\#005533\">\n"; print " <TR><TD>\n"; print "$username\n";

you can write

print <<END; <HR> <TABLE border=0 width=100% bgcolor="#005533"> <TR><TD> $username END
Instead of END, it can be any word and that word must appear alone to end the here document.