]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www*stream: favor \&close instead of *close
authorEric Wong <e@yhbt.net>
Sat, 25 Jan 2020 04:44:49 +0000 (04:44 +0000)
committerEric Wong <e@yhbt.net>
Mon, 27 Jan 2020 02:59:09 +0000 (02:59 +0000)
Be explicit that we're making a code reference, and not
a reference to a scalar, array, hash, or IO...

lib/PublicInbox/WwwAtomStream.pm
lib/PublicInbox/WwwStream.pm

index 9ec1383dada276b101a35df7ea3809692609567e..cb7ffe353f54838ed2d9559bd0ac43113096adef 100644 (file)
@@ -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 {
index a724d0697db589121e08acd48b2ff5b9003e4736..ef5897b26a2f8cc7aeadec7d7ba7ddafef41a282 100644 (file)
@@ -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;