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 1C09C1F5A1 for ; Sat, 25 Jan 2020 04:45:11 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 01/22] www*stream: favor \&close instead of *close Date: Sat, 25 Jan 2020 04:44:49 +0000 Message-Id: <20200125044510.13769-2-e@yhbt.net> In-Reply-To: <20200125044510.13769-1-e@yhbt.net> References: <20200125044510.13769-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Be explicit that we're making a code reference, and not a reference to a scalar, array, hash, or IO... --- lib/PublicInbox/WwwAtomStream.pm | 2 +- lib/PublicInbox/WwwStream.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm index 9ec1383d..cb7ffe35 100644 --- a/lib/PublicInbox/WwwAtomStream.pm +++ b/lib/PublicInbox/WwwAtomStream.pm @@ -23,7 +23,7 @@ sub new { my ($class, $ctx, $cb) = @_; $ctx->{emit_header} = 1; $ctx->{feed_base_url} = $ctx->{-inbox}->base_url($ctx->{env}); - bless { cb => $cb || *close, ctx => $ctx }, $class; + bless { cb => $cb || \&close, ctx => $ctx }, $class; } sub response { diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index a724d069..ef5897b2 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -23,7 +23,7 @@ sub new { chop $base_url; # no trailing slash for clone bless { nr => 0, - cb => $cb || *close, + cb => $cb || \&close, ctx => $ctx, base_url => $base_url, }, $class;