in reply to How do you deal with HTML in Perl?
Update: As for making heredocs look better in your code, indenting really helps:
my $text = "Hello, World!"; print <<" EOF"; <html> <head> <title>Example</title> </head> <body> <p>$text</p> </body> </html> EOF
Just make sure to quote the proper amount of white space before the EOF marker (also use double quotes unless you don't want variable interpolation).