Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use IO::Socket;
- $sock = new IO::Socket::INET {
- PeerAddr => "irc.foonetic.net",
- PeerPort => 6667,
- Proto => ('tcp') || die "Error at this point no. 001 : $!";
- print $sock "USER Sean 8 * :Earl Curl\r\n";
- print $sock "NICK Geniusalex\r\n";
- while($line = <$sock>) {
- chomp $line;
- if($line =~ /001/) {
- print $sock "JOIN #lingubender\r\n";
- }
- if ($line =~ /^PING(.*)$/i) {
- print $sock "PONG $1\r\n";
- }else {
- # Print line.
- print "$line\n";
- if($line =~ /Hi/) {
- print $sock "PRIVMSG #lingubender :hello\r\n";
- }
- }
- }
- close($sock);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement