X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwStatic.pm;h=eeb5e565039ec47c7a715e1ae2c6d993cbb2dbbf;hb=8d2513221e73649aed85ce8c3f37f7025ec1fec9;hp=29e4819dfc4b51e52fa5d8baec2a1c5ffb7b82f1;hpb=9dfc0b670fc634b54998c3020f173b82de1915ac;p=public-inbox.git diff --git a/lib/PublicInbox/WwwStatic.pm b/lib/PublicInbox/WwwStatic.pm index 29e4819d..eeb5e565 100644 --- a/lib/PublicInbox/WwwStatic.pm +++ b/lib/PublicInbox/WwwStatic.pm @@ -9,8 +9,8 @@ # functionality of nginx. package PublicInbox::WwwStatic; use strict; +use v5.10.1; use parent qw(Exporter); -use bytes (); use Fcntl qw(SEEK_SET O_RDONLY O_NONBLOCK); use POSIX qw(strftime); use HTTP::Date qw(time2str); @@ -218,7 +218,7 @@ my %path_re_cache; sub path_info_raw ($) { my ($env) = @_; my $sn = $env->{SCRIPT_NAME}; - my $re = $path_re_cache{$sn} ||= do { + my $re = $path_re_cache{$sn} //= do { $sn = '/'.$sn unless index($sn, '/') == 0; $sn =~ s!/\z!!; qr!\A(?:https?://[^/]+)?\Q$sn\E(/[^\?\#]+)!; @@ -318,7 +318,7 @@ sub dir_response ($$$) { "
Index of $path_info_html

\n");
 	$gzf->zmore(join("\n", @entries));
 	my $out = $gzf->zflush("

\n"); - $h->[3] = bytes::length($out); + $h->[3] = length($out); [ 200, $h, [ $out ] ] }