#!/usr/bin/perl use strict; use Event; use Net::Knuddels; my $client = new Net::Knuddels::Client PeerAddr => "213.61.5.150:2710"; $client->login; my %channels; $client->register (b => sub { for (@_) { if ($_ ne "-") { } else { } } }); $client->register (UNHANDLED => sub { use Dumpvalue; print "---\n"; Dumpvalue->new (compactDump => 1, veryCompact => 1, quoteHighBit => 1, tick => '"')->dumpValue ([@_]); }); $client->register (login => sub { $client->set_nick ("Zwickau", "Net-Knuddels", "lolfe"); }); $client->register (msg_room => sub { my ($room, $user, $msg) = @_; print "($room) $user: $msg\n"; }); $client->register (msg_priv => sub { my ($room, $src, $dst, $msg) = @_; print "($room) ########### $src an $dst: $msg\n"; }); Event->io ( fd => $client->fh, poll => 'r', cb => sub { $client->ready }); Event::loop;