Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use IO::Socket;
  4. $sock = new IO::Socket::INET {
  5. PeerAddr => "irc.foonetic.net",
  6. PeerPort => 6667,
  7. Proto => ('tcp') || die "Error at this point no. 001 : $!";
  8. print $sock "USER Sean 8 * :Earl Curl\r\n";
  9. print $sock "NICK Geniusalex\r\n";
  10. while($line = <$sock>) {
  11. chomp $line;
  12. if($line =~ /001/) {
  13. print $sock "JOIN #lingubender\r\n";
  14. }
  15. if ($line =~ /^PING(.*)$/i) {
  16. print $sock "PONG $1\r\n";
  17. }else {
  18. # Print line.
  19. print "$line\n";
  20. if($line =~ /Hi/) {
  21. print $sock "PRIVMSG #lingubender :hello\r\n";
  22. }
  23. }
  24. }
  25. close($sock);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement