| 1 |
elmex |
1.1 |
#!/usr/bin/perl |
| 2 |
|
|
use Net::IRC::Server; |
| 3 |
|
|
use Data::Dumper; |
| 4 |
|
|
|
| 5 |
elmex |
1.2 |
my $s = Net::IRC::Server->new (); |
| 6 |
elmex |
1.1 |
|
| 7 |
|
|
print $s->mk_msg ("soo.serv.de", "NOTICE", "not auth"); |
| 8 |
|
|
|
| 9 |
|
|
$s->set_cmd_cb ("*", sub { |
| 10 |
|
|
my ($client, $msg) = @_; |
| 11 |
|
|
print "$msg->{prefix} $msg->{command} @{$msg->{params}}\n"; |
| 12 |
|
|
0; |
| 13 |
|
|
}); |
| 14 |
|
|
|
| 15 |
|
|
$s->set_send_cb (sub { |
| 16 |
|
|
my ($cl, $data) = @_; |
| 17 |
|
|
print "SEND: $cl $data\n"; |
| 18 |
|
|
|
| 19 |
|
|
}); |
| 20 |
|
|
|
| 21 |
|
|
my $mecl = { hostname => "fun" }; |
| 22 |
|
|
|
| 23 |
|
|
while (<STDIN>) { |
| 24 |
|
|
$s->parse_irc_stream ($mecl, $_); |
| 25 |
|
|
} |