From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 81FD41F43D for ; Mon, 13 Mar 2023 19:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1678736307; bh=ZgHsFlw/kySSX1URSwBncKiiGAUPHyuSTz+MMHyEyGc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=zMrkox85ZQ5Urj2tEWHDcuNgTc1LdNTb74jTQ5gljL3zUOQ/Gcy1YMsv2DRn0Xw2M 8UVW0kmaNh8U8E/kisofftAjYdxaao0SQHNbTitAleKCaXRYmzN87Rje3wtcJrW2zq Ogzu4igvTITK3xGGiEgeOyRNL7xaYPVv56o4KGhk= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] use v5.12 for various network client-side packages Date: Mon, 13 Mar 2023 19:38:25 +0000 Message-Id: <20230313193827.3635690-2-e@80x24.org> In-Reply-To: <20230313193827.3635690-1-e@80x24.org> References: <20230313193827.3635690-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: None of these are affected by the Perl unicode_strings feature, so they can `use v5.12' safely --- lib/PublicInbox/GitCredential.pm | 8 +++++--- lib/PublicInbox/NetNNTPSocks.pm | 5 ++--- lib/PublicInbox/NetReader.pm | 3 +-- lib/PublicInbox/NetWriter.pm | 5 ++--- lib/PublicInbox/URIimap.pm | 5 ++--- lib/PublicInbox/URInntps.pm | 4 ++-- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/PublicInbox/GitCredential.pm b/lib/PublicInbox/GitCredential.pm index b18bba1e..10114a10 100644 --- a/lib/PublicInbox/GitCredential.pm +++ b/lib/PublicInbox/GitCredential.pm @@ -1,7 +1,9 @@ -# Copyright (C) 2020-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ + +# git-credential wrapper with built-in .netrc fallback package PublicInbox::GitCredential; -use strict; +use v5.12; use PublicInbox::Spawn qw(popen_rd); sub run ($$;$) { @@ -19,7 +21,7 @@ sub run ($$;$) { my $out = ''; for my $k (qw(url protocol host username password)) { - defined(my $v = $self->{$k}) or next; + my $v = $self->{$k} // next; die "`$k' contains `\\n' or `\\0'\n" if $v =~ /[\n\0]/; $out .= "$k=$v\n"; } diff --git a/lib/PublicInbox/NetNNTPSocks.pm b/lib/PublicInbox/NetNNTPSocks.pm index 8495204a..fcd2e580 100644 --- a/lib/PublicInbox/NetNNTPSocks.pm +++ b/lib/PublicInbox/NetNNTPSocks.pm @@ -1,10 +1,9 @@ -# Copyright (C) 2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # wrap Net::NNTP client with SOCKS support package PublicInbox::NetNNTPSocks; -use strict; -use v5.10.1; +use v5.12; use Net::NNTP; our %OPT; our @ISA = qw(IO::Socket::Socks); diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index 4de2583e..6802fa72 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -3,8 +3,7 @@ # common reader code for IMAP and NNTP (and maybe JMAP) package PublicInbox::NetReader; -use strict; -use v5.10.1; +use v5.12; use parent qw(Exporter PublicInbox::IPC); use PublicInbox::Eml; use PublicInbox::Config; diff --git a/lib/PublicInbox/NetWriter.pm b/lib/PublicInbox/NetWriter.pm index 4a1f34f6..7917ef89 100644 --- a/lib/PublicInbox/NetWriter.pm +++ b/lib/PublicInbox/NetWriter.pm @@ -1,10 +1,9 @@ -# Copyright (C) 2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # common writer code for IMAP (and later, JMAP) package PublicInbox::NetWriter; -use strict; -use v5.10.1; +use v5.12; use parent qw(PublicInbox::NetReader); use PublicInbox::Smsg; use PublicInbox::MsgTime qw(msg_timestamp); diff --git a/lib/PublicInbox/URIimap.pm b/lib/PublicInbox/URIimap.pm index 81644914..41c2842a 100644 --- a/lib/PublicInbox/URIimap.pm +++ b/lib/PublicInbox/URIimap.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2020-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # cf. RFC 5092, which the `URI' package doesn't support # @@ -11,8 +11,7 @@ # # RFC 2192 also describes ";TYPE=" package PublicInbox::URIimap; -use strict; -use v5.10.1; +use v5.12; use URI::Split qw(uri_split uri_join); # part of URI use URI::Escape qw(uri_unescape uri_escape); use overload '""' => \&as_string; diff --git a/lib/PublicInbox/URInntps.pm b/lib/PublicInbox/URInntps.pm index 231b247b..88c8d641 100644 --- a/lib/PublicInbox/URInntps.pm +++ b/lib/PublicInbox/URInntps.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # deal with the lack of URI::nntps in upstream URI. @@ -6,7 +6,7 @@ # cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983419 # Fixed in URI 5.08, we can drop this by 2035 when LTS distros all have it package PublicInbox::URInntps; -use strict; +use v5.12; use parent qw(URI::snews); use URI;