1 |
elmex |
1.1 |
#!/usr/bin/perl |
2 |
root |
1.2 |
|
3 |
elmex |
1.1 |
use strict; |
4 |
root |
1.2 |
|
5 |
|
|
use Event; |
6 |
elmex |
1.1 |
use Net::Knuddels; |
7 |
|
|
|
8 |
root |
1.2 |
my $knudi = new Net::Knuddels::Client PeerAddr => "213.61.5.150:2710"; |
9 |
elmex |
1.1 |
|
10 |
root |
1.2 |
$knudi->login; |
11 |
elmex |
1.1 |
|
12 |
|
|
my %channels; |
13 |
|
|
|
14 |
root |
1.2 |
$knudi->register (b => sub { |
15 |
elmex |
1.1 |
for (@_) { |
16 |
|
|
if ($_ ne "-") { |
17 |
|
|
|
18 |
|
|
} else { |
19 |
|
|
|
20 |
|
|
|
21 |
|
|
} |
22 |
|
|
} |
23 |
|
|
}); |
24 |
|
|
|
25 |
root |
1.2 |
$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 |
elmex |
1.1 |
|
37 |
root |
1.2 |
Event::loop; |
38 |
elmex |
1.1 |
|
39 |
|
|
|