Just FYI, the POE::Component::IRC module on CPAN will do this all for you.

On 7/3/05, Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] [dwt], on Sunday, July 3, 2005 at 15:04
> (+0100) wrote about:
> 
> 
> dwt> :<senders host name> PRIVMSG <#channelname> :<message>
> dwt> At the moment I am using the if statement:
> dwt> if($input =~ /m*PRIVMSG*:/i)
> dwt> , but it is never true.
> 
> if message looks like this:
> :somewhere.host.com PRIVMSG #channel : message
> 
> you should use for example:
> 
> if ($input =~ /^:[^\s]+\sPRIVMSG\s+(.*?)\s*:\s*(.*)/) {
>    print "Channel:$1 Message: $2\n";
> }
> 
> ...you should learn regexpes, they are very cool for parsing some
> text.
> 
> 
> --
> 
>  ...m8s, cu l8r, Brano.
> 
> [Gun Control? Ask Lorena Bobitt about knife Control!]
> 
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 


-- 
-Stuart, The Digital Guerrilla
www.quickfry.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to