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,
         'time' => 1148224087,
       };

SEE ALSO

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

VERSION

$Id: Bot.pm 483 2006-05-22 21:36:46Z 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