about summary refs log tree commit homepage
path: root/lib/PublicInbox/NNTP.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-09-09 18:43:55 +0000
committerEric Wong <e@80x24.org>2016-09-09 18:43:55 +0000
commit365d594829b963a9c95526ebb2af8859a0c4bc93 (patch)
treefeaaeb995b0b9ff43d0b144670f05c3aab422608 /lib/PublicInbox/NNTP.pm
parentefc69a789c61a6f2ad6516b3e684f96656a8c81c (diff)
downloadpublic-inbox-365d594829b963a9c95526ebb2af8859a0c4bc93.tar.gz
This clarifies the code somewhat, and we don't care to lazy-load
in NNTP.pm anyways since this is only used for a long-lived
daemon.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r--lib/PublicInbox/NNTP.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 7bfc6dd6..b7143ff3 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -15,6 +15,8 @@ require PublicInbox::EvCleanup;
 use Email::Simple;
 use POSIX qw(strftime);
 use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
+use Digest::SHA qw(sha1_hex);
+use Time::Local qw(timegm timelocal);
 use constant {
         r501 => '501 command syntax error',
         r221 => '221 Header follows',
@@ -237,7 +239,6 @@ sub cmd_listgroup ($;$) {
 
 sub parse_time ($$;$) {
         my ($date, $time, $gmt) = @_;
-        use Time::Local qw();
         my ($hh, $mm, $ss) = unpack('A2A2A2', $time);
         if (defined $gmt) {
                 $gmt =~ /\A(?:UTC|GMT)\z/i or die "GM invalid: $gmt";
@@ -255,9 +256,9 @@ sub parse_time ($$;$) {
                 }
         }
         if ($gmt) {
-                Time::Local::timegm($ss, $mm, $hh, $DD, $MM - 1, $YYYY);
+                timegm($ss, $mm, $hh, $DD, $MM - 1, $YYYY);
         } else {
-                Time::Local::timelocal($ss, $mm, $hh, $DD, $MM - 1, $YYYY);
+                timelocal($ss, $mm, $hh, $DD, $MM - 1, $YYYY);
         }
 }
 
@@ -286,7 +287,6 @@ sub wildmat2re (;$) {
         return $_[0] = qr/.*/ if (!defined $_[0] || $_[0] eq '*');
         my %keep;
         my $salt = rand;
-        use Digest::SHA qw(sha1_hex);
         my $tmp = $_[0];
 
         $tmp =~ s#(?<!\\)\[(.+)(?<!\\)\]#