+else {
+ my $href = showlink($source, $source =~ m{\A (\w+) \.plp \z}x && "/$1");
+ PLP_START {
+ say "<h1>Source of $href</h1>";
+ };
+
+ if ($source =~ m{(?:/|^)\.}) {
+ Abort("File request not permitted", '403 source not allowed');
+ }
+ elsif ($source =~ s{::}{/}g or !-e $source) {
+ $source .= '.pm';
+ for (0 .. $#INC) {
+ -e ($_ = "$INC[$_]/$source") or next;
+ $source = $_;
+ last;
+ }
+ }
+ -r $source or Abort("Requested file not found", '404 source not found');
+ my $size = (stat $source)->[7];
+
+ if (my $hl = eval {
+ $size < 32_768 or die 'large files take too long to parse';
+ require Text::VimColor;
+ Text::VimColor->VERSION(0.12)
+ or die 'early versions are buggy under FastCGI';
+ delete $Text::VimColor::SYNTAX_TYPE{Underlined};
+ return Text::VimColor->new(
+ file => $source,
+ vim_options => [@Text::VimColor::VIM_OPTIONS, '+:set enc=utf-8'],
+ )->marked;
+ }) {
+ my %TYPETAG = (
+ Statement => 'strong',
+ Error => 'em',
+ Todo => 'em',
+ );