http://www.perlmonks.org?node_id=887632

roho has asked for the wisdom of the Perl Monks concerning the following question:

I have been searching for the equivalent of perltidy, HTML::Tidy, etc. for Template Toolkit files.

I have inherited some rather challenging tt files to maintain, and they are sorely in need of reformatting. There are many nested control statements (see examples below) that are not indented, which makes deciphering the logic flow next to impossible.

[% IF %] [% ELSE %] [% END %] [% WHILE %] [% FOREACH %] etc.

Does anyone know of a utility to reformat tt files? I tried Template::Plugin::PerlTidy, but unfortunately its reformatting is no better (in many ways worse) than the original tt file.

"Its not how hard you work, its how much you get done."