use Perl::Tidy(); my $html = ""; Perl::Tidy::perltidy( source => $modfile, destination => \$html, argv => " -html ", stderr => File::Spec->devnull, ); return $html;