in reply to Re^2: A Quick OO Module for parsing lines from an IRC connection
in thread A Quick OO Module for parsing lines from an IRC connection
Something like this?
my $sock = IO::Socket::INET->new('localhost:6669'); print "pass this_is_the_passwd\n"; print $sock "pass this_is_the_pw\r"; print "nick whateverhack\n"; print $sock "nick whateverhack\r";
later on I always to stuff like this to parse messages people send (here p.e. all messages from hitty:
LOOP: while (<$sock>) { $line = $_; if ( $line =~ / 366 / ) { print "$line\r"; } if ( $line =~ /PRIVMSG/ ) { $line =~ /^:(.*)!(.*) PRIVMSG (.*) :(.*?)--(.*).$/; $from = $1; $room = $3; $cam = $4; if ($cam eq "") { next LOOP; } $comment = $5; if ( $cam =~ /hitty/ ) { print "<$from\@$cam> $comment\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: A Quick OO Module for parsing lines from an IRC connection
by SoupNazi (Acolyte) on Aug 26, 2005 at 20:40 UTC |