#!/usr/bin/perl

# This demo applet creates an agent with a couple of variables,  and
# then packs itself ready for transportation.

use Agent;

$my_agent = new Agent;
$date = `date`;

# add some new variables to the agent.  If I were modifying existing
# variables I would say $my_agent->write instead.

$my_agent->add(Name => 'Time',
	       Value => $date);
$my_agent->add(Name => 'Author',
	      Value  => 'James Duncan');
$my_agent->addcode( Code => 'print \'Ed\';' );
$my_agent->setpriority( Level => 'Urgent' );

# pack the agent up for transportation into $trs.
$trs = $my_agent->sleep();

# print the agent to the screen.  Can be piped to a file for later unpacking?
print $trs;

# and thasall folks!