]> Sergey Matveev's repositories - public-inbox.git/commitdiff
treewide: "require" + "use" cleanup and docs
authorEric Wong <e@yhbt.net>
Sun, 5 Jan 2020 23:23:35 +0000 (23:23 +0000)
committerEric Wong <e@yhbt.net>
Mon, 6 Jan 2020 10:21:00 +0000 (10:21 +0000)
There's a bunch of leftover "require" and "use" statements we no
longer need and can get rid of, along with some excessive
imports via "use".

IO::Handle usage isn't always obvious, so add comments
describing why a package loads it.  Along the same lines,
document the tmpdir support as the reason we depend on
File::Temp 0.19, even though every Perl 5.10.1+ user has it.

While we're at it, favor "use" over "require", since it it gives
us extra compile-time checking.

32 files changed:
Makefile.PL
lib/PublicInbox/DS.pm
lib/PublicInbox/Daemon.pm
lib/PublicInbox/Emergency.pm
lib/PublicInbox/ExtMsg.pm
lib/PublicInbox/Filter/RubyLang.pm
lib/PublicInbox/Git.pm
lib/PublicInbox/GitHTTPBackend.pm
lib/PublicInbox/HTTP.pm
lib/PublicInbox/HTTPD.pm
lib/PublicInbox/Import.pm
lib/PublicInbox/Listener.pm
lib/PublicInbox/MboxGz.pm
lib/PublicInbox/NNTPD.pm
lib/PublicInbox/Search.pm
lib/PublicInbox/SearchIdx.pm
lib/PublicInbox/SearchView.pm
lib/PublicInbox/SolverGit.pm
lib/PublicInbox/Spawn.pm
lib/PublicInbox/TLS.pm
lib/PublicInbox/Tmpfile.pm
lib/PublicInbox/V2Writable.pm
lib/PublicInbox/ViewDiff.pm
lib/PublicInbox/WatchMaildir.pm
lib/PublicInbox/WwwAtomStream.pm
lib/PublicInbox/Xapcmd.pm
script/public-inbox-convert
script/public-inbox-edit
script/public-inbox-init
script/public-inbox-nntpd
t/cgi.t
t/feed.t

index b8c05cf7ea75e99e9522eec65eee6378d41c7cd4..3492d9653ece202ae1061970798828f4c9a3d78e 100644 (file)
@@ -137,7 +137,7 @@ WriteMakefile(
                # All Perl installs I know about have these, but RH-based
                # distros make them separate even though 'perl' pulls them in
                'File::Path' => 0,
                # All Perl installs I know about have these, but RH-based
                # distros make them separate even though 'perl' pulls them in
                'File::Path' => 0,
-               'File::Temp' => '0.19',
+               'File::Temp' => '0.19', # for ->tmpdir support
                'Getopt::Long' => 0,
                'Exporter' => 0,
                # ExtUtils::MakeMaker # this file won't run w/o it...
                'Getopt::Long' => 0,
                'Exporter' => 0,
                # ExtUtils::MakeMaker # this file won't run w/o it...
index 8f17f7fb3d3b0db79ae5ebc93ba6aa9fb0e2daa5..09dc399250a30382d73592b8015e5ae19a9fabb3 100644 (file)
@@ -35,9 +35,8 @@ use fields ('sock',              # underlying socket
             'wbuf_off',  # offset into first element of wbuf to start writing at
             );
 
             'wbuf_off',  # offset into first element of wbuf to start writing at
             );
 
-use Errno  qw(EAGAIN EINVAL);
-use Carp   qw(croak confess carp);
-require File::Spec;
+use Errno qw(EAGAIN EINVAL);
+use Carp qw(confess carp);
 
 my $nextq; # queue for next_tick
 my $WaitPids; # list of [ pid, callback, callback_arg ]
 
 my $nextq; # queue for next_tick
 my $WaitPids; # list of [ pid, callback, callback_arg ]
index 9db472a19479b5fdfd271c6c60c6597116cadbe9..292bc339a73c086f06c4a34bc47f63e3e962b4ed 100644 (file)
@@ -6,7 +6,7 @@ package PublicInbox::Daemon;
 use strict;
 use warnings;
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 use strict;
 use warnings;
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
-use IO::Handle;
+use IO::Handle; # ->autoflush
 use IO::Socket;
 use POSIX qw(WNOHANG :signal_h);
 use Socket qw(IPPROTO_TCP SOL_SOCKET);
 use IO::Socket;
 use POSIX qw(WNOHANG :signal_h);
 use Socket qw(IPPROTO_TCP SOL_SOCKET);
index 5ce75a797d6b6bc266f4a37edd4a626af61d5317..8c0cc18425b4c65aff680dbbd51e05b3bf90aa3a 100644 (file)
@@ -7,7 +7,7 @@ use strict;
 use warnings;
 use Fcntl qw(:DEFAULT SEEK_SET);
 use Sys::Hostname qw(hostname);
 use warnings;
 use Fcntl qw(:DEFAULT SEEK_SET);
 use Sys::Hostname qw(hostname);
-use IO::Handle;
+use IO::Handle; # ->flush, ->autoflush
 
 sub new {
        my ($class, $dir) = @_;
 
 sub new {
        my ($class, $dir) = @_;
index 549e44955e8c6db0810f622ea77722e189d77cf9..49fc1ac5521c1506acb137afaf1f667f666f231d 100644 (file)
@@ -9,7 +9,6 @@ package PublicInbox::ExtMsg;
 use strict;
 use warnings;
 use PublicInbox::Hval qw(ascii_html prurl);
 use strict;
 use warnings;
 use PublicInbox::Hval qw(ascii_html prurl);
-use PublicInbox::MID qw/mid2path/;
 use PublicInbox::WwwStream;
 our $MIN_PARTIAL_LEN = 16;
 
 use PublicInbox::WwwStream;
 our $MIN_PARTIAL_LEN = 16;
 
index 094ac1c2e7f6b56fe22b017ba80873c5e522b0ea..3a8dd881ebfd9e2ee8c9b08ca8d98866079714f1 100644 (file)
@@ -22,7 +22,6 @@ sub new {
                $altid ||= $ibx->{altid}->[0];
        }
        if ($altid) {
                $altid ||= $ibx->{altid}->[0];
        }
        if ($altid) {
-               require PublicInbox::MID; # mid_clean
                require PublicInbox::AltId;
                $self->{-altid} = PublicInbox::AltId->new($ibx, $altid, 1);
        }
                require PublicInbox::AltId;
                $self->{-altid} = PublicInbox::AltId->new($ibx, $altid, 1);
        }
index 8d587469f3eb5828ca6dbb4756f54a66db1cc1b7..6a527f82f9145ada72a1abbf053bf1987009283d 100644 (file)
@@ -10,7 +10,7 @@ package PublicInbox::Git;
 use strict;
 use warnings;
 use POSIX qw(dup2);
 use strict;
 use warnings;
 use POSIX qw(dup2);
-require IO::Handle;
+use IO::Handle; # ->autoflush
 use PublicInbox::Spawn qw(spawn popen_rd);
 use PublicInbox::Tmpfile;
 use base qw(Exporter);
 use PublicInbox::Spawn qw(spawn popen_rd);
 use PublicInbox::Tmpfile;
 use base qw(Exporter);
index d1132fb7492c8b5039532fdc224ac9d348abcceb..81ff23fc006d409cb8c5fd2f0d1efa0425fcf0cb 100644 (file)
@@ -7,7 +7,7 @@ package PublicInbox::GitHTTPBackend;
 use strict;
 use warnings;
 use Fcntl qw(:seek);
 use strict;
 use warnings;
 use Fcntl qw(:seek);
-use IO::Handle;
+use IO::Handle; # ->flush
 use HTTP::Date qw(time2str);
 use PublicInbox::Qspawn;
 use PublicInbox::Tmpfile;
 use HTTP::Date qw(time2str);
 use PublicInbox::Qspawn;
 use PublicInbox::Tmpfile;
index d2f04ba541e3865c2a9f6d0aa2a9b0781cadfc58..1346901ad52300fd4b9985c18ba912502ce0f649 100644 (file)
@@ -15,9 +15,10 @@ use fields qw(httpd env input_left remote_addr remote_port forward alive);
 use bytes (); # only for bytes::length
 use Fcntl qw(:seek);
 use Plack::HTTPParser qw(parse_http_request); # XS or pure Perl
 use bytes (); # only for bytes::length
 use Fcntl qw(:seek);
 use Plack::HTTPParser qw(parse_http_request); # XS or pure Perl
+use Plack::Util;
 use HTTP::Status qw(status_message);
 use HTTP::Date qw(time2str);
 use HTTP::Status qw(status_message);
 use HTTP::Date qw(time2str);
-use IO::Handle;
+use IO::Handle; # ->write
 use PublicInbox::DS qw(msg_more);
 use PublicInbox::Syscall qw(EPOLLIN EPOLLONESHOT);
 use PublicInbox::Tmpfile;
 use PublicInbox::DS qw(msg_more);
 use PublicInbox::Syscall qw(EPOLLIN EPOLLONESHOT);
 use PublicInbox::Tmpfile;
index 47f5a01a786daa8e7d0c6bf859cfd417541aa7c3..1331a91ee9bf9c5f5f190f6be70ee6b77c7235d0 100644 (file)
@@ -7,8 +7,8 @@ package PublicInbox::HTTPD;
 use strict;
 use warnings;
 use Plack::Util;
 use strict;
 use warnings;
 use Plack::Util;
-require PublicInbox::HTTPD::Async;
-require PublicInbox::Daemon;
+use PublicInbox::HTTPD::Async;
+use PublicInbox::Daemon;
 
 sub pi_httpd_async { PublicInbox::HTTPD::Async->new(@_) }
 
 
 sub pi_httpd_async { PublicInbox::HTTPD::Async->new(@_) }
 
index 20669ab9709b710eaf21c284116ef3453b753de6..572e9bb9899fc464671510dc26275d51d6b7ce8c 100644 (file)
@@ -10,7 +10,7 @@ use strict;
 use warnings;
 use base qw(PublicInbox::Lock);
 use PublicInbox::Spawn qw(spawn);
 use warnings;
 use base qw(PublicInbox::Lock);
 use PublicInbox::Spawn qw(spawn);
-use PublicInbox::MID qw(mids mid_mime mid2path);
+use PublicInbox::MID qw(mids mid2path);
 use PublicInbox::Address;
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
 use PublicInbox::ContentId qw(content_digest);
 use PublicInbox::Address;
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
 use PublicInbox::ContentId qw(content_digest);
index 821c34583e24a75c386bc6f650a3fd1186479f12..928d9301902fdb059ddbd4a2603af92cb6848736 100644 (file)
@@ -8,7 +8,7 @@ use warnings;
 use base 'PublicInbox::DS';
 use Socket qw(SOL_SOCKET SO_KEEPALIVE IPPROTO_TCP TCP_NODELAY);
 use fields qw(post_accept);
 use base 'PublicInbox::DS';
 use Socket qw(SOL_SOCKET SO_KEEPALIVE IPPROTO_TCP TCP_NODELAY);
 use fields qw(post_accept);
-require IO::Handle;
+use IO::Handle;
 use PublicInbox::Syscall qw(EPOLLIN EPOLLEXCLUSIVE EPOLLET);
 use Errno qw(EAGAIN ECONNABORTED EPERM);
 
 use PublicInbox::Syscall qw(EPOLLIN EPOLLEXCLUSIVE EPOLLET);
 use Errno qw(EAGAIN ECONNABORTED EPERM);
 
index 2b873451e585945f8939df08eaabd47cc02030db..08e3c8464c4fb800fc075cd145d92ec16820a39e 100644 (file)
@@ -6,7 +6,6 @@ use warnings;
 use Email::Simple;
 use PublicInbox::Hval qw/to_filename/;
 use PublicInbox::Mbox;
 use Email::Simple;
 use PublicInbox::Hval qw/to_filename/;
 use PublicInbox::Mbox;
-use IO::Compress::Gzip;
 use Compress::Raw::Zlib qw(Z_FINISH Z_OK);
 my %OPT = (-WindowBits => 15 + 16, -AppendOutput => 1);
 
 use Compress::Raw::Zlib qw(Z_FINISH Z_OK);
 my %OPT = (-WindowBits => 15 + 16, -AppendOutput => 1);
 
index 0f79f8f9a9daad240d2260ffcf6c286df28b33a5..925691bc52f4dd62d201fffc4404963675db2e26 100644 (file)
@@ -7,7 +7,7 @@ package PublicInbox::NNTPD;
 use strict;
 use warnings;
 use Sys::Hostname;
 use strict;
 use warnings;
 use Sys::Hostname;
-require PublicInbox::Config;
+use PublicInbox::Config;
 
 sub new {
        my ($class) = @_;
 
 sub new {
        my ($class) = @_;
index aff3d48b694170a08741042afdc4e8afbf2df590..5c9dccb53af327282d10df960f7f112801986e58 100644 (file)
@@ -13,8 +13,6 @@ use constant YYYYMMDD => 1; # Date: header for searching in the WWW UI
 use constant DT => 2; # Date: YYYYMMDDHHMMSS
 
 use PublicInbox::SearchMsg;
 use constant DT => 2; # Date: YYYYMMDDHHMMSS
 
 use PublicInbox::SearchMsg;
-use PublicInbox::MIME;
-use PublicInbox::MID qw/id_compress/;
 use PublicInbox::Over;
 my $QP_FLAGS;
 our %X = map { $_ => 0 } qw(BoolWeight Database Enquire
 use PublicInbox::Over;
 my $QP_FLAGS;
 our %X = map { $_ => 0 } qw(BoolWeight Database Enquire
index 0d983aabdc9825044ec9cdbe1b6fafd21a2e7779..f14809d25fe361a827dc3f18a21e14a594594f2b 100644 (file)
@@ -12,7 +12,7 @@ use warnings;
 use base qw(PublicInbox::Search PublicInbox::Lock);
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
 use base qw(PublicInbox::Search PublicInbox::Lock);
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
-use PublicInbox::MID qw/mid_clean id_compress mid_mime mids_for_index/;
+use PublicInbox::MID qw/mid_clean mid_mime mids_for_index/;
 use PublicInbox::MsgIter;
 use Carp qw(croak);
 use POSIX qw(strftime);
 use PublicInbox::MsgIter;
 use Carp qw(croak);
 use POSIX qw(strftime);
index 6587d37fb9f94011e955ada6cb6139172cddd398..0d2e71fda534d4819ae23813516d4df9b74f7c45 100644 (file)
@@ -10,10 +10,7 @@ use PublicInbox::SearchMsg;
 use PublicInbox::Hval qw/ascii_html obfuscate_addrs/;
 use PublicInbox::View;
 use PublicInbox::WwwAtomStream;
 use PublicInbox::Hval qw/ascii_html obfuscate_addrs/;
 use PublicInbox::View;
 use PublicInbox::WwwAtomStream;
-use PublicInbox::MID qw(MID_ESC);
-use PublicInbox::MIME;
-require PublicInbox::Git;
-require PublicInbox::SearchThread;
+use PublicInbox::SearchThread;
 our $LIM = 200;
 my %rmap_inc;
 
 our $LIM = 200;
 my %rmap_inc;
 
@@ -350,7 +347,6 @@ package PublicInbox::SearchQuery;
 use strict;
 use warnings;
 use URI::Escape qw(uri_escape);
 use strict;
 use warnings;
 use URI::Escape qw(uri_escape);
-use PublicInbox::Hval;
 use PublicInbox::MID qw(MID_ESC);
 
 sub new {
 use PublicInbox::MID qw(MID_ESC);
 
 sub new {
index 5ac27988591c961a9335735727d8b3cf80f825a4..8629f0dafeb4216b41ac2c0951c866c8e76c2dcf 100644 (file)
@@ -11,7 +11,7 @@ package PublicInbox::SolverGit;
 use strict;
 use warnings;
 use 5.010_001;
 use strict;
 use warnings;
 use 5.010_001;
-use File::Temp 0.19 ();
+use File::Temp 0.19 (); # 0.19 for ->newdir
 use Fcntl qw(SEEK_SET);
 use PublicInbox::Git qw(git_unquote git_quote);
 use PublicInbox::MsgIter qw(msg_iter msg_part_text);
 use Fcntl qw(SEEK_SET);
 use PublicInbox::Git qw(git_unquote git_quote);
 use PublicInbox::MsgIter qw(msg_iter msg_part_text);
index 6eea2b9c7ff0886d5e5b0756a5ceb1da04253d30..1c74a5964aa59235d51eaa6af7bbb9b37fecb4eb 100644 (file)
@@ -15,7 +15,6 @@ use strict;
 use warnings;
 use base qw(Exporter);
 use Symbol qw(gensym);
 use warnings;
 use base qw(Exporter);
 use Symbol qw(gensym);
-use IO::Handle;
 use PublicInbox::ProcessPipe;
 our @EXPORT_OK = qw/which spawn popen_rd/;
 sub RLIMITS () { qw(RLIMIT_CPU RLIMIT_CORE RLIMIT_DATA) }
 use PublicInbox::ProcessPipe;
 our @EXPORT_OK = qw/which spawn popen_rd/;
 sub RLIMITS () { qw(RLIMIT_CPU RLIMIT_CORE RLIMIT_DATA) }
index 0b9a55dfd237c22bfd1aa24c3b9bdeef9cd447ff..1bbb229adbcd7f6cc8c60c076ea18b3a5a1d4978 100644 (file)
@@ -5,8 +5,6 @@
 package PublicInbox::TLS;
 use strict;
 use IO::Socket::SSL;
 package PublicInbox::TLS;
 use strict;
 use IO::Socket::SSL;
-require Carp;
-use Errno qw(EAGAIN);
 use PublicInbox::Syscall qw(EPOLLIN EPOLLOUT);
 
 sub err () { $SSL_ERROR }
 use PublicInbox::Syscall qw(EPOLLIN EPOLLOUT);
 
 sub err () { $SSL_ERROR }
index 28e87f882efcb144df8b8dfc684ce1942a231278..05f359d844cb0fc8f74ca9af461ff928405ae39e 100644 (file)
@@ -7,7 +7,7 @@ use base qw(Exporter);
 our @EXPORT = qw(tmpfile);
 use Fcntl qw(:DEFAULT);
 use Errno qw(EEXIST);
 our @EXPORT = qw(tmpfile);
 use Fcntl qw(:DEFAULT);
 use Errno qw(EEXIST);
-require File::Spec;
+use File::Spec;
 
 # use tmpfile instead of open(..., '+>', undef) so we can get an
 # unlinked filename which makes sense when viewed with lsof
 
 # use tmpfile instead of open(..., '+>', undef) so we can get an
 # unlinked filename which makes sense when viewed with lsof
index c614e20c382518e6d257b59871b4eb109d839869..6021de4496a5e08b2504bbf5498a0d0d112427c6 100644 (file)
@@ -18,7 +18,7 @@ use PublicInbox::OverIdx;
 use PublicInbox::Msgmap;
 use PublicInbox::Spawn qw(spawn);
 use PublicInbox::SearchIdx;
 use PublicInbox::Msgmap;
 use PublicInbox::Spawn qw(spawn);
 use PublicInbox::SearchIdx;
-use IO::Handle;
+use IO::Handle; # ->autoflush
 use File::Temp qw(tempfile);
 
 # an estimate of the post-packed size to the raw uncompressed size
 use File::Temp qw(tempfile);
 
 # an estimate of the post-packed size to the raw uncompressed size
index 4d72eb4807199c272c32f133fbcbfb38e982648a..10d71004caab28e1d9920dff3e0c11714126756e 100644 (file)
@@ -12,7 +12,7 @@ use warnings;
 use base qw(Exporter);
 our @EXPORT_OK = qw(flush_diff);
 use URI::Escape qw(uri_escape_utf8);
 use base qw(Exporter);
 our @EXPORT_OK = qw(flush_diff);
 use URI::Escape qw(uri_escape_utf8);
-use PublicInbox::Hval qw(ascii_html to_attr from_attr);
+use PublicInbox::Hval qw(ascii_html to_attr);
 use PublicInbox::Git qw(git_unquote);
 
 # keep track of state so we can avoid redundant HTML tags for
 use PublicInbox::Git qw(git_unquote);
 
 # keep track of state so we can avoid redundant HTML tags for
index 7803b58ac3399b742f6957047329d40d4e118bbf..8a8c1262737034f6415bec853d87c7b2898b2cd3 100644 (file)
@@ -9,7 +9,7 @@ use warnings;
 use PublicInbox::MIME;
 use PublicInbox::Spawn qw(spawn);
 use PublicInbox::InboxWritable;
 use PublicInbox::MIME;
 use PublicInbox::Spawn qw(spawn);
 use PublicInbox::InboxWritable;
-use File::Temp 0.19 ();
+use File::Temp 0.19 (); # 0.19 for ->newdir
 use PublicInbox::Filter::Base qw(REJECT);
 use PublicInbox::Spamcheck;
 *maildir_path_load = *PublicInbox::InboxWritable::maildir_path_load;
 use PublicInbox::Filter::Base qw(REJECT);
 use PublicInbox::Spamcheck;
 *maildir_path_load = *PublicInbox::InboxWritable::maildir_path_load;
index 84060cfa198c89d55dec100e26bd3d6e90cc58c6..9430dd97679eed5049d65de63bc96129b8159b27 100644 (file)
@@ -13,7 +13,7 @@ use POSIX qw(strftime);
 use Digest::SHA qw(sha1_hex);
 use PublicInbox::Address;
 use PublicInbox::Hval qw(ascii_html);
 use Digest::SHA qw(sha1_hex);
 use PublicInbox::Address;
 use PublicInbox::Hval qw(ascii_html);
-use PublicInbox::MID qw/mid_clean mid_escape/;
+use PublicInbox::MID qw(mid_escape);
 use PublicInbox::MsgTime qw(msg_timestamp);
 
 # called by PSGI server after getline:
 use PublicInbox::MsgTime qw(msg_timestamp);
 
 # called by PSGI server after getline:
index 544242a36663594d489aa4a54bfa13e77e30cdd6..4871378e6314ed6612c1ad91414200df8b40e234 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use PublicInbox::Spawn qw(which spawn);
 use PublicInbox::Over;
 use PublicInbox::SearchIdx;
 use PublicInbox::Spawn qw(which spawn);
 use PublicInbox::Over;
 use PublicInbox::SearchIdx;
-use File::Temp ();
+use File::Temp 0.19 (); # ->newdir
 use File::Path qw(remove_tree);
 use File::Basename qw(dirname);
 use POSIX ();
 use File::Path qw(remove_tree);
 use File::Basename qw(dirname);
 use POSIX ();
index 9bee5e7a323b437eaa0c6077458879a0b2464301..633c4cf8d9906e9b760e5feba1a24b0d9d66be49 100755 (executable)
@@ -4,11 +4,9 @@
 use strict;
 use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use strict;
 use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
-use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
 use PublicInbox::Config;
 use PublicInbox::V2Writable;
 use PublicInbox::InboxWritable;
 use PublicInbox::Config;
 use PublicInbox::V2Writable;
-use PublicInbox::Import;
 use PublicInbox::Spawn qw(spawn);
 use Cwd 'abs_path';
 use File::Copy 'cp'; # preserves permissions:
 use PublicInbox::Spawn qw(spawn);
 use Cwd 'abs_path';
 use File::Copy 'cp'; # preserves permissions:
index 2a9f0531f7377dfc4f2c02a995c7133eeb579fdd..e408c7bccdd260f1e37086d41e095240e873552d 100755 (executable)
@@ -8,13 +8,13 @@ use strict;
 use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use PublicInbox::AdminEdit;
 use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use PublicInbox::AdminEdit;
-use File::Temp 0.19 ();
+use File::Temp 0.19 (); # 0.19 for TMPDIR
 use PublicInbox::ContentId qw(content_id);
 use PublicInbox::MID qw(mid_clean mids);
 PublicInbox::Admin::check_require('-index');
 use PublicInbox::ContentId qw(content_id);
 use PublicInbox::MID qw(mid_clean mids);
 PublicInbox::Admin::check_require('-index');
-require PublicInbox::MIME;
-require PublicInbox::InboxWritable;
-require PublicInbox::Import;
+use PublicInbox::MIME;
+use PublicInbox::InboxWritable;
+use PublicInbox::Import;
 
 my $usage = "$0 -m MESSAGE_ID [--all] [INBOX_DIRS]";
 my $opt = { verbose => 1, all => 0, -min_inbox_version => 2, raw => 0 };
 
 my $usage = "$0 -m MESSAGE_ID [--all] [INBOX_DIRS]";
 my $opt = { verbose => 1, all => 0, -min_inbox_version => 2, raw => 0 };
index da683657a0b1b38fd54a44dcc35af32dbcc677b6..34c93b47882c3b52623a4de583197cc3c90f57cd 100755 (executable)
@@ -14,8 +14,8 @@ EOF
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 use PublicInbox::Admin;
 PublicInbox::Admin::require_or_die('-base');
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 use PublicInbox::Admin;
 PublicInbox::Admin::require_or_die('-base');
-require PublicInbox::Config;
-require PublicInbox::InboxWritable;
+use PublicInbox::Config;
+use PublicInbox::InboxWritable;
 use File::Temp qw/tempfile/;
 use PublicInbox::Lock;
 use File::Basename qw/dirname/;
 use File::Temp qw/tempfile/;
 use PublicInbox::Lock;
 use File::Basename qw/dirname/;
index 3c4be191b6cea1d64a96f70dddb9fd29ef535487..27c33f0497b217268a27ffe9003c28a5e9e72275 100755 (executable)
@@ -5,9 +5,9 @@
 # Standalone NNTP server for public-inbox.
 use strict;
 use warnings;
 # Standalone NNTP server for public-inbox.
 use strict;
 use warnings;
-require PublicInbox::Daemon;
+use PublicInbox::Daemon;
 use PublicInbox::NNTP; # need to call import
 use PublicInbox::NNTP; # need to call import
-require PublicInbox::NNTPD;
+use PublicInbox::NNTPD;
 my $nntpd = PublicInbox::NNTPD->new;
 PublicInbox::Daemon::run('0.0.0.0:119',
        sub { $nntpd->refresh_groups }, # refresh
 my $nntpd = PublicInbox::NNTPD->new;
 PublicInbox::Daemon::run('0.0.0.0:119',
        sub { $nntpd->refresh_groups }, # refresh
diff --git a/t/cgi.t b/t/cgi.t
index 90543a7a51c9f3b87dfbc939bc326255f1ba65a2..9f67d5c0bd0004d89275c0d4e22a615993c3bc48 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -32,8 +32,6 @@ EOF
        close $fh or die "close: $!\n";
 }
 
        close $fh or die "close: $!\n";
 }
 
-use_ok 'PublicInbox::Git';
-use_ok 'PublicInbox::Import';
 use_ok 'PublicInbox::Inbox';
 use_ok 'PublicInbox::InboxWritable';
 use_ok 'PublicInbox::Config';
 use_ok 'PublicInbox::Inbox';
 use_ok 'PublicInbox::InboxWritable';
 use_ok 'PublicInbox::Config';
index b2a944875c4acfbd6f676301b98fac1f0aa9220f..ec8a5a42e9ae3ee635a6f592e64e8789efd66bfb 100644 (file)
--- a/t/feed.t
+++ b/t/feed.t
@@ -5,9 +5,7 @@ use warnings;
 use Test::More;
 use Email::MIME;
 use PublicInbox::Feed;
 use Test::More;
 use Email::MIME;
 use PublicInbox::Feed;
-use PublicInbox::Git;
 use PublicInbox::Import;
 use PublicInbox::Import;
-use PublicInbox::Config;
 use PublicInbox::Inbox;
 my $have_xml_feed = eval { require XML::Feed; 1 };
 use PublicInbox::TestCommon;
 use PublicInbox::Inbox;
 my $have_xml_feed = eval { require XML::Feed; 1 };
 use PublicInbox::TestCommon;