in reply to Misformatted HTML::Template source code

I do not know why do you worry about identation of generated HTML, but as workaround I can suggest to shift <TMPL_VAR NAME='PAGEBODY'> to the left, thus you can get pretty output.

<html> <head> ... </head> <body> <div> <TMPL_VAR NAME='PAGEBODY'> </div> </body> </html>