File: intro-01-helloworld.pl

package info (click to toggle)
libnet-async-irc-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 200 kB
  • sloc: perl: 970; sh: 2; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 439 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

use v5.14;
use warnings;

use Future::AsyncAwait 0.47; # toplevel await

use IO::Async::Loop;
use Net::Async::IRC;

my $loop = IO::Async::Loop->new;

my $irc = Net::Async::IRC->new;
$loop->add( $irc );

my $SERVER = "irc.example.net";
my $NICK = "MyNick";
my $TARGET = "TargetNick";

await $irc->login(
   host => $SERVER,
   nick => $NICK,
);

await $irc->do_PRIVMSG(
   target => $TARGET,
   text   => "Hello, World"
);