karstenda has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks!

I ran into a tiny AIM script here at a node written by sutch (http://www.perlmonks.org/?node_id=250057). He says that this script should work, however when I run the script with my working screen name and password, it looks like it won't receive the \&on_config handler, and is thereby stuck in the loop.

I've tryed different scripts but they all seem to have the same problem.

Any ideas?



#!/usr/bin/perl use strict; use Net::AIM; sub DEBUG() { 1 } my $aim = new Net::AIM; $aim->debug(1) if (DEBUG); # provides helpful information $aim->newconn( Screenname => 'admin', Password => 'adminpass') or + die "Can't connect to AIM server.\n"; my $conn = $aim->getconn(); $conn->set_handler('config', \&on_config); $aim->set('config_done', 0); my $done = 0; while (! $done) { $aim->do_one_loop(); if ($aim->get('config_done')) { $aim->send_im('evelyntube', 'testing'); print "\nmessage send!\n"; sleep 5; $done = 1; } else { $aim->do_one_loop(); } } sub on_config { my ($self, $evt, $from, $to) = @_; my $str = shift @{$evt->args()}; $self->set_config_str($str, 1); $self->send_config(); $self->set('config_done', 1); }
If the script is working for you