From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 32A571F463 for ; Mon, 6 Jan 2020 05:31:07 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] wwwstatic: use sprintf for Perl <5.22 compatibility Date: Mon, 6 Jan 2020 05:31:07 +0000 Message-Id: <20200106053107.26428-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We only declare a Perl 5.10.1+ requirement, and POSIX::lround was not added until 5.21.4 (5.22.0 for stable releases). --- lib/PublicInbox/WwwStatic.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/WwwStatic.pm b/lib/PublicInbox/WwwStatic.pm index bc42236e..917049bb 100644 --- a/lib/PublicInbox/WwwStatic.pm +++ b/lib/PublicInbox/WwwStatic.pm @@ -12,7 +12,7 @@ use strict; use parent qw(Exporter); use bytes (); use Fcntl qw(SEEK_SET O_RDONLY O_NONBLOCK); -use POSIX qw(strftime lround); +use POSIX qw(strftime); use HTTP::Date qw(time2str); use HTTP::Status qw(status_message); use Errno qw(EACCES ENOTDIR ENOENT); @@ -238,7 +238,7 @@ sub human_size ($) { last; } } - lround($size).$suffix; + sprintf('%lu', $size).$suffix; } # by default, this returns "index.html" if it exists for a given directory