25 lines
451 B
Perl
25 lines
451 B
Perl
#!/usr/bin/env perl
|
|
|
|
use IO::Async::Loop;
|
|
use Net::Async::IRC;
|
|
|
|
my $loop = IO::Async::Loop->new;
|
|
|
|
my $irc = Net::Async::IRC->new(
|
|
on_message_text => sub {
|
|
my ( $self, $message, $hints ) = @_;
|
|
|
|
print "$hints->{prefix_name} says: $hints->{text}\n";
|
|
},
|
|
);
|
|
|
|
$loop->add( $irc );
|
|
|
|
$irc->login(
|
|
nick => "MyName",
|
|
host => "192.168.32.1",
|
|
)->get;
|
|
|
|
$irc->do_PRIVMSG( target => "simcop2387", text => "Hello world!" );
|
|
|
|
$loop->run;
|