use strict; use warnings; use Perl::Tidy; use CGI qw(:standard); open FH, '<', '/path/to/perlfile.pl' or die $!; my $content = do {local $/;}; my $html; perltidy( source => \$content, destination => \$html, argv => '-html -npod -css=/path/to/perltidy.css', errorfile => '/dev/null', ); print header, start_html( -title => 'Colorized Perl', -style => { src => '/URL/to/perltidy.css' }, ), $html, end_html, ;