| Parse-Colloquy-Bot documentation | view source | Contained in the Parse-Colloquy-Bot distribution. |
Parse::Colloquy::Bot - Parse Colloquy bot/client terminal output
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);
This module will parse the raw "client" or "bot" terminal line output from a connection to a Colloquy server.
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.
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,
};
$Id: Bot.pm 483 2006-05-22 21:36:46Z nicolaw $
Nicola Worthington <nicolaw@cpan.org>
Copyright 2006 Nicola Worthington.
This software is licensed under The Apache Software License, Version 2.0.
| Parse-Colloquy-Bot documentation | view source | Contained in the Parse-Colloquy-Bot distribution. |