The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Parse::Colloquy::Bot - Parse Colloquy Bot/Client Terminal Output

SYNOPSIS

 use strict;
 use Parse::Colloquy::Bot qw(:all);
 use Data::Dumper;
 
 # ... connect to Colloquy and read from the server ...
 my $parsed = parse_line($raw_input);
 print Dumper($parsed);  
 

DESCRIPTION

This module will parse the raw "client" or "bot" terminal line output from a connection to a Colloquy server.

FUNCTIONS

parse_line

Accepts a single scalar input line or an array of input. Will return a hash reference or array of hash references for each input line, depending on the context that the function called.

EXAMPLE

The following input line from Colloquy:

 LISTTALK neech2      %hello my name is neech {perl}

Will be parsed in to the following structure:

 $VAR1 = {
          'raw' => 'LISTTALK neech2      %hello my name is neech {perl}',
          'msgtype' => 'LISTTALK',
          'person' => 'neech2',
          'list' => '%perl'
          'text' => 'hello my name is neech',
          'args' => [
                      'hello',
                      'my',
                      'name',
                      'is',
                      'neech'
                    ],
          'command' => 'hello',
          'cmdargs' => [
                         'my',
                         'name',
                         'is',
                         'neech'
                       ],
          'respond' => undef,
        };

SEE ALSO

Colloquy::Data, Colloquy::Bot::Simple, Chatbot::TalkerBot

VERSION

$Id: Bot.pm 465 2006-05-19 20:55:11Z nicolaw $

AUTHOR

Nicola Worthington <nicolaw@cpan.org>

http://perlgirl.org.uk

COPYRIGHT

Copyright 2006 Nicola Worthington.

This software is licensed under The Apache Software License, Version 2.0.

http://www.apache.org/licenses/LICENSE-2.0