IRC::add_message_handler("PRIVMSG", "privmsg_handler"); open ( SHB, " ); close SHB; sub privmsg_handler { $thingy = $_[0]; $_ = $thingy; ( $nick, $user, $host, $hook, $channel, $say ) = (m/:(\S+)!(\S+)\@(\S+)\s(\w+)\s(\S+)\s:(.*)/); if ($say =~ /^!shobon$/i ) { $answer = $shobon[rand @shobon]; IRC::send_raw ( "PRIVMSG $channel :$answer\n" ); } return 0; }