0

I'm trying to write an extremely simple IRC client which sets the topic on a given channel (for which it first needs to identify and gain ops). Ideally I want to be able to write something like this:

$client = new IRC::Client(%config);
$client->connect();
$client->identify('password');
$client->join('#channel');
$client->op('#channel'); # gain ops
$client->set_topic('#channel', 'new topic');
$client->disconnect();

Is there a module which supports this limited functionality, with a simple interface? All the IRC-related modules on metacpan seem to be aimed at people wanting to write fully functional bots - I've looked at Bot::BasicBot, but that seems to want me to subclass the module, and AnyEvent::IRC::Client seems quite low level. I don't want to write event-handling code, just connect, issue a few commands, and disconnect.

pwaring
  • 3,032
  • 8
  • 30
  • 46
  • how about `POE::Component::IRC`? – orhanhenrik Aug 25 '12 at 20:37
  • That seems overly complicated and low level for what I need - I don't even understand the code like $irc->yield( register => 'all' );. – pwaring Aug 25 '12 at 20:40
  • `Net::IRC` looks quite simple, haven't used it before though – orhanhenrik Aug 25 '12 at 20:43
  • Unfortunately it's been deprecated since 2004. – pwaring Aug 25 '12 at 20:53
  • 4
    IRC isn't the kind of protocol that you can do correctly without event-driven code. You need to be able to say "connect; when I get end-of-motd, identify. When I get successfully-identified, join. When I get joined, op up. When I get the mode line, change topic", etc. – hobbs Aug 25 '12 at 20:58
  • I thought a module would do that for me - in the same way that I can do 'connect, when I get to end of MOTD, change directory, when I've changed directory, upload file' with the various FTP modules. In other words, I wouldn't expect the connect() method to return until it had finished - i.e. got to the end of the MOTD. – pwaring Aug 26 '12 at 08:48

1 Answers1

0

Consider also Net::Async::IRC.

LeoNerd
  • 8,344
  • 1
  • 29
  • 36