in reply to Net::AIM Sorrows

I don't think you can directly call $aim->getconn->add_handler('config', \&init); I'd suggest
my $conn = $aim->getconn; $conn->add_handler('config', \&init);
Also, I may be wrong, but I thought the method was set_handler not add_handler...

Replies are listed 'Best First'.
Re: Re: Net::AIM Sorrows
by porkpilot (Deacon) on May 24, 2003 at 09:03 UTC
    The Mad Hatter is right--you need to break these up:

    my $AIM = new Net::AIM; $AIM->newconn(Screenname => $name, Password => $password, AutoReconnect => 1) or die "Unable to open AIM connection.\n"; my $conn = $AIM->getconn();

    Then, once you have $conn, you can set handlers, send messages and so forth:

    sub send_aim { local($_) = shift; my $ready = 0; $conn->set_handler(config => sub {$ready = 1}); $AIM->do_one_loop; $conn->send_im($to_screenname, "From $name: $_"); }

    See also, this node and this site for more info. (Wiredbots.com has good examples for setting/using handlers.)