10 Usage: $0 [options] command [arguments]
14 Options are as follows, with defaults in brackets:
16 -n, --nick=[$IRCNICK] IRC nickname.
17 -s, --server=[$IRCSERVER] IRC server.
19 Available commands (with arguments) are:
21 who #channel List the visible users on a channel.
22 whois username ... Query information about particular users.
29 nick => $ENV{IRCNICK},
30 server => $ENV{IRCSERVER},
39 usage if $options{help};
41 my $command = shift or usage;
42 $command = lc $command;
44 if ($command eq 'who')
46 scalar @ARGV == 1 or usage;
48 elsif ($command eq 'whois')
50 scalar @ARGV > 0 or usage;
57 my $irc = new Net::IRC;
59 my $conn = $irc->newconn(Nick => $mynick, Server => $server)
60 or die "$0: can't connect to IRC server";
65 $self->who($targetchannel);
70 my ($self, $event) = @_;
71 my ($me, $channel, $user, $host,
72 $server, $nick, $status, $realname) = $event->args;
73 printf "\%-12s \%s\n", $nick, $realname;
83 $conn->add_handler('376', \&on_connect);
84 $conn->add_handler('352', \&on_whoreply);
85 $conn->add_handler('315', \&on_endofwho);