]> Sergey Matveev's repositories - public-inbox.git/commitdiff
remove "no warnings 'once'" in a few places
authorEric Wong <e@80x24.org>
Mon, 23 Dec 2019 23:06:03 +0000 (23:06 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 Dec 2019 03:46:57 +0000 (03:46 +0000)
We can use "use" to get the namespace into the "BEGIN" phase of
the interpreter.  While we're at it, use \&coderef syntax
explicitly instead of globbing everything.

lib/PublicInbox/Spawn.pm
lib/PublicInbox/WwwListing.pm
script/public-inbox-purge

index 6493ad387cdbcb915ca71fcbdc325f0ce673f768..c64812ddf4a3fb01e6bb13f3c1489316a78693c1 100644 (file)
@@ -172,8 +172,7 @@ if (defined $vfork_spawn) {
 
 unless (defined $vfork_spawn) {
        require PublicInbox::SpawnPP;
-       no warnings 'once';
-       *pi_fork_exec = *PublicInbox::SpawnPP::pi_fork_exec
+       *pi_fork_exec = \&PublicInbox::SpawnPP::pi_fork_exec
 }
 
 sub which ($) {
index 03534f03e670c6b92e5da18ab4975984fe88a6ed..bcb968af9b73c79c2af922b107c7ca1d32342da7 100644 (file)
@@ -9,11 +9,12 @@ use warnings;
 use PublicInbox::Hval qw(ascii_html);
 use PublicInbox::Linkify;
 use PublicInbox::View;
+use PublicInbox::Inbox;
 use bytes ();
 use HTTP::Date qw(time2str);
 require Digest::SHA;
 require File::Spec;
-{ no warnings 'once'; *try_cat = *PublicInbox::Inbox::try_cat };
+*try_cat = \&PublicInbox::Inbox::try_cat;
 
 sub list_all ($$$) {
        my ($self, $env, $hide_key) = @_;
index 0705d170eae8806f706c75e246cd7594b2b20f20..f103ccf7e9795a6201902b30e645fad5f12aeb01 100755 (executable)
@@ -9,11 +9,11 @@ use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use PublicInbox::AdminEdit;
 PublicInbox::Admin::check_require('-index');
-require PublicInbox::Filter::Base;
-require PublicInbox::MIME;
+use PublicInbox::Filter::Base;
+use PublicInbox::MIME;
 require PublicInbox::V2Writable;
 
-{ no warnings 'once'; *REJECT = *PublicInbox::Filter::Base::REJECT }
+*REJECT = \&PublicInbox::Filter::Base::REJECT;
 
 my $usage = "$0 [--all] [INBOX_DIRS] </path/to/message";
 my $opt = { verbose => 1, all => 0, -min_inbox_version => 2 };