ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-IRC-Server/samples/test_parse
Revision: 1.3
Committed: Fri Jan 14 17:01:54 2005 UTC (19 years, 5 months ago) by elmex
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
Log Message:
documentations, minor improvements

File Contents

# Content
1 #!/usr/bin/perl
2 use Net::IRC::Server;
3 use Data::Dumper;
4
5 my $s = Net::IRC::Server->new ();
6
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->feed_irc_data ($mecl, $_);
25 }