1 ================================================================================
5 In our first lesson, we'll create an IRC bot that rolls the
8 Copy the code for dicebot.pl to your home folder:
10 $ cp dicebot.pl ~/dicebot.pl
12 Next, open up dicebot.pl using a text editor and make a few changes.
13 (We recommend vim because it provides syntax highlighting)
15 1. Edit the server in line 20. Replace irc.example.com with the server's
16 real address. NOTE: Only IPv4 is supported.
17 2. Edit line 23 to replace nickname with the nickname you want for the bot.
18 WARNING: The nickname must not already be taken, or else the bot will
20 3. Edit line 24 to replace username with the username you want for the bot.
21 The username is what appears in a /whois on IRC; it can be different
24 Next, you'll want to make the perl script executable:
26 $ chmod u+x ~/dicebot.pl
32 On IRC, /join #perl101
34 Type !roll and you'll see the bot rolls a pair of virtual dice.
36 In less than 5 minutes, you've created your first IRC bot with perl.
38 ================================================================================
42 Next, take a look at the file called ~/comments to see an explanation of
43 key lines in the program.
45 ================================================================================