Agent::Message - the Transportable Agent Perl module
use Agent; my $msg = new Agent::Message( Body => [ 'foo bar', 'baz' ], Transport => TCP, Address => '127.0.0.1:24368' ); $msg->send;
This module is meant to standardize agent communications over a number of different transport mediums (see Agent::Transport).
new makes a nice new Message object with all the arguments you pass it. It understands the following parameters:
new
Message
Body => $body, [ Transport => $medium, Address => $destination, SendNow => $true_false ]
This instantiates the class with only one destination (multiple destinations are possible - see below). If SendNow is true, the message is dispatched ASAP.
Sets/gets the body of the message.
Adds the destination address to the list of destinations within said medium; adds the medium if need be.
Removes the destination address from the list of destinations within said medium. If last destination in medium, removes medium also.
Removes the specified transport medium and all of its destinations.
Sends the message body in all transport mediums. Passes \%args to all transport mediums when sending. Returns an array of results returned by each transport medium the message was sent in.
\%args
$msg->del_dest and $msg->del_transport don't work; I'm too lazy.
Agent, Agent::Transport, the example agents.
Agent
Agent::Transport
Steve Purkis <spurkis@engsoc.carleton.ca>
Copyright (c) 1998 Steve Purkis. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Whoever invented mail.
To install Agent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Agent
CPAN shell
perl -MCPAN -e shell install Agent
For more information on module installation, please visit the detailed CPAN module installation guide.