XHTML is very ok. You can turn it off with use CGI qw(-no_xhtml);. If you put CGI.pm xhtml output into the middle of an HTML4 template it could cause the resulting HTML to cough up some minor validation errors but browsers should be able to handle them gracefully.