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.0 required=3.0 tests=ALL_TRUSTED,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 085AA1FA10 for ; Tue, 12 Oct 2021 11:47:06 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/9] nntp: use defined-OR from Perl 5.10 for msgid check Date: Tue, 12 Oct 2021 11:47:00 +0000 Message-Id: <20211012114705.383-5-e@80x24.org> In-Reply-To: <20211012114705.383-1-e@80x24.org> References: <20211012114705.383-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: "<0>" could be a valid Message-ID, maybe... --- lib/PublicInbox/NNTP.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index ea9ce183..aa019368 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -9,6 +9,7 @@ # long_cb: long_response private data package PublicInbox::NNTP; use strict; +use v5.10.1; use parent qw(PublicInbox::DS); use PublicInbox::MID qw(mid_escape $MID_EXTRACT); use PublicInbox::Eml; @@ -381,11 +382,10 @@ sub article_adj ($$) { defined $n or return '420 no current article has been selected'; $n += $off; - my $mid = $ibx->mm(1)->mid_for($n); - unless ($mid) { + my $mid = $ibx->mm(1)->mid_for($n) // do { $n = $off > 0 ? 'next' : 'previous'; return "421 no $n article in this group"; - } + }; $self->{article} = $n; "223 $n <$mid> article retrieved - request text separately"; }