1 |
#!/usr/bin/perl |
2 |
|
3 |
use strict; |
4 |
|
5 |
use Event; |
6 |
use Net::Knuddels; |
7 |
|
8 |
my $knudi = new Net::Knuddels::Client PeerAddr => "213.61.5.150:2710"; |
9 |
|
10 |
$knudi->login; |
11 |
|
12 |
my %channels; |
13 |
|
14 |
$knudi->register (b => sub { |
15 |
for (@_) { |
16 |
if ($_ ne "-") { |
17 |
|
18 |
} else { |
19 |
|
20 |
|
21 |
} |
22 |
} |
23 |
}); |
24 |
|
25 |
$knudi->register (ALL => sub { |
26 |
use Dumpvalue; |
27 |
print "---\n"; |
28 |
Dumpvalue->new (compactDump => 1, veryCompact => 1, quoteHighBit => 1, tick => '"')->dumpValue ([@_]); |
29 |
}); |
30 |
|
31 |
$knudi->register (login => sub { |
32 |
$knudi->set_nick ("Zwickau", "Net-Knuddels", "lolfe"); |
33 |
}); |
34 |
|
35 |
Event->io ( fd => $knudi->fh, poll => 'r', cb => sub { $knudi->ready }); |
36 |
|
37 |
Event::loop; |
38 |
|
39 |
|