From: timriker Date: Sun, 25 Jul 2004 00:42:32 +0000 (+0000) Subject: stdin support - testing X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1134b493c2a764679b9b33aff8556218f551cde3;p=infobot.git stdin support - testing git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1013 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/IRC/Irc.pl b/src/IRC/Irc.pl index e07ab26..cf2d86b 100644 --- a/src/IRC/Irc.pl +++ b/src/IRC/Irc.pl @@ -6,7 +6,9 @@ # use strict; + no strict 'refs'; +no strict 'subs'; # IN/STDIN use vars qw(%floodjoin %nuh %dcc %cache %conns %channels %param %mask %chanconf %orig %ircPort %ircstats %last %netsplit); @@ -17,6 +19,9 @@ use vars qw($notcount $nottime $notsize $msgcount $msgtime $msgsize use vars qw($b_blue $ob); use vars qw(@ircServers); +use open ':utf8'; +use open ':std'; + $nickserv = 0; my $maxlinelen = 400; @@ -170,10 +175,9 @@ sub irc { $ircstats{'Server'} = "$server:$port"; - #&DEBUG("foo" . ); - #open(FH, "<:utf8", "input"); - #$irc->addfh(, \&on_stdin, "r"); - #close(STDIN); + $irc->addfh(STDIN, \&on_stdin, "r"); + + &status("starting main loop"); $irc->start; } diff --git a/src/IRC/IrcHooks.pl b/src/IRC/IrcHooks.pl index aa92211..ca6bcce 100644 --- a/src/IRC/IrcHooks.pl +++ b/src/IRC/IrcHooks.pl @@ -1262,8 +1262,6 @@ sub on_useronchan { # TODO not used yet sub on_stdin { - &FIXME("on_stdin"); - my $line = ; chomp($line); &FIXME("on_stdin: line => \"$line\"");