sub redirect_whois { my ($data, $signal, %hashtable) = ($_[0], $_[1], %{$_[2]}); weechat::print("", "perl: redirect_whois perl: error: '".$hashtable{"error"}."', output:\n".$hashtable{"output"}); return weechat::WEECHAT_RC_OK; } weechat::register("redirect", "Sebastien Helleu ", "0.1", "GPL3", "IRC redirection example", "", ""); weechat::hook_hsignal("irc_redirection_whois_flashcode", "redirect_whois", ""); my $hash = { "server" => "local", "pattern" => "whois", "signal" => "flashcode", "count" => "1", "argument" => "FlashCode", "timeout" => "0", "cmd_filter" => "" }; weechat::hook_hsignal_send("irc_redirect_command", $hash); weechat::hook_signal_send("irc_input_send", weechat::WEECHAT_HOOK_SIGNAL_STRING, "local;;;;/whois FlashCode");