in reply to Hanging program

Try putting some print statements at useful points in your program, e.g. That at least will tell you what method is failing, and with that information, we might be able to help you more.

Replies are listed 'Best First'.
Re: Re: Hanging program
by Anonymous Monk on Apr 11, 2003 at 03:05 UTC
    Program dies after "Information is being passed.". Does this help?
    #!/usr/bin/perl use strict; use warnings; my $user = "wfgs343R"; my $pass = "iamcool"; my $aim; print "Subject's Name:"; chomp(my $destuser = <STDIN>); print "Message:"; chomp(my $message = <STDIN>); use Net::AOLIM; $aim = Net::AOLIM->new( 'username' => $user, 'password' => $pass, 'callback' => \&callbackfunction, 'server' => 'toc.oscar.aol.com', 'port' => 1234, 'allow_srv_settings' => 1, 'login_server' => 'login.oscar.aol.com', 'login_port' => 5198, 'login_timeout' => 0, 'aim_agent' => "$Net::AOLIM::VERSION"); print "Information is being passed.\n"; $aim->signon; print "Aim is signed on.\n"; $aim->toc_send_im($destuser, $message); print "Done\n";
      You are missing () after $aim->signon I dont know if this makes a difference honestly. You should check the return value of signon, when I ran your code, (with my aim of course) the return value of signon was undef (which the docs say means it failed). According to the documentation there are some error messages you can get back (IM_ERR). Try printing those out.
      Also, it takes about thirty or forty seconds for the signon to fail, are you waiting long enough?
      Good luck,
      Josh