in reply to Re: I can't seem to figure out Net::AIM
in thread I can't seem to figure out Net::AIM

Replacing $aim->start; with $aim->do_one_loop; causes the same problem as deleting that line completely. I get this error: "(in cleanup) No method called "handler" for object. at Untitled line 0"

Adding this line from the node you linked doesn't seem to make a difference, either:
$conn->set_handler(config => sub {$ready = 1});

Replies are listed 'Best First'.
Re^3: I can't seem to figure out Net::AIM
by eric256 (Parson) on Sep 12, 2005 at 19:59 UTC

    $aim->start; is the same as saying while (1) { $aim->do_one_loop; }. Anything after that whlie loop is never going to get called. Instead of trying to run the do_one_loop by hand you probably want to add a config handler. I beleive that is the best handler and aim calls it after you are logged in. So your code would look something like:

    $conn->set_handler(config => sub { my $aim = shift; $aim->send_im('gazuga69', 'It worked!'); }); $aim->start;


    ___________
    Eric Hodges
      I'm still having the same problem. It runs forever without ever sending the instant message. I added some print statements to the anonymous subroutine for debugging and apparently it never gets run. Here's the updated version:

      use Net::AIM; my $aim = new Net::AIM; $aim->newconn(Screenname => 'TeamMonkeyCrap', Password => '*******'); my $conn = $aim->getconn(); $conn->set_handler(config => sub { my $aim = shift; $aim->send_im('gazuga69', 'It worked!'); }); $aim->start();