#!/usr/bin/perl -w use CGI; use CGI::Carp qw(fatalsToBrowser); use lib '/home/samn/cgi-bin/lib/'; use Net::AIM; use Data::Dumper; # preove that the module is listening ;-) # print "Content-type: text/html\n\nNet::AIM Version: ", $Net::AIM::VERSION; # exit; $aim = new Net::AIM; $conn = $aim->newconn(Screenname => 'Robotskull', Password => 'password'); # check our objects using Data::Dumper (need to escape HTML, pre tag etc) #$q = new CGI; #my $data = Dumper ($aim , $conn); #$data = $q->escapeHTML($data); #print $q->header, "
$data
"; #exit; $conn->set_handler('im_in',\&on_im); $aim->start; sub on_im { my ($self, $event) = @_; my ($nick) = $event->from; print $event->dump; my @args = $event->args; $self->send_im($nick, "Hi $nick. You said: $args[2]"); }