]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NNTP.pm
nntp: get rid of some unused imports
[public-inbox.git] / lib / PublicInbox / NNTP.pm
index 6cd2b84ce7725abd7857c5be71fe4520db6c1525..e41e3f64d71e1cab5e8322e3c0bbc1c8ac514b5b 100644 (file)
@@ -7,10 +7,7 @@ use strict;
 use warnings;
 use base qw(PublicInbox::DS);
 use fields qw(nntpd article ng);
-use PublicInbox::Search;
-use PublicInbox::Msgmap;
 use PublicInbox::MID qw(mid_escape);
-use PublicInbox::Git;
 use Email::Simple;
 use POSIX qw(strftime);
 use PublicInbox::DS qw(now);
@@ -81,10 +78,7 @@ sub process_line ($$) {
        my ($self, $l) = @_;
        my ($req, @args) = split(/[ \t]/, $l);
        return 1 unless defined($req); # skip blank line
-       $req = eval {
-               no strict 'refs';
-               *{'cmd_'.lc($req)}{CODE};
-       };
+       $req = $self->can('cmd_'.lc($req));
        return res($self, '500 command not recognized') unless $req;
        return res($self, r501) unless args_ok($req, scalar @args);
 
@@ -173,11 +167,7 @@ sub cmd_list ($;$$) {
                my $arg = shift @args;
                $arg =~ tr/A-Z./a-z_/;
                $arg = "list_$arg";
-
-               $arg = eval {
-                       no strict 'refs';
-                       *{$arg}{CODE};
-               };
+               $arg = $self->can($arg);
                return r501 unless $arg && args_ok($arg, scalar @args);
                more($self, '215 information follows');
                $arg->($self, @args);