-# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# Standalone PSGI app to provide syntax highlighting as-a-service
package PublicInbox::WwwHighlight;
use strict;
-use warnings;
-use bytes (); # only for bytes::length
+use v5.10.1;
use parent qw(PublicInbox::HlMod);
use PublicInbox::Linkify qw();
use PublicInbox::Hval qw(ascii_html);
return \$buf if $r == 0;
$off += $r;
}
- $env->{'psgi.errors'}->print("input read error: $!\n");
+ warn "input read error: $!";
undef;
}
$l->linkify_2($$bref);
my $h = [ 'Content-Type', 'text/html; charset=UTF-8' ];
- push @$h, 'Content-Length', bytes::length($$bref);
+ push @$h, 'Content-Length', length($$bref);
[ 200, $h, [ $$bref ] ]
}