Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::Oscar errors.

Status
Not open for further replies.

MikeSpo

Technical User
Jul 13, 2009
5
US
I am running on Windows with ActivePerl.

I got the latest Net::Oscar module from CPAN.
I did what it told me, with the Build.pl
"perl Build.pl" - ok
"perl Build" - ok
"perl Build test" - bad
"perl Build install" - Ran but I dont think it was very good.

When I tried to run the script using this module I got this:

Prototype mismatch: sub Net::OSCAR::Connection::F_GETFL () vs none at (eval 5) line 1.
Prototype mismatch: sub Net::OSCAR::Connection::F_SETFL () vs none at (eval 6) line 1.
Prototype mismatch: sub Net::OSCAR::Connection::O_NONBLOCK () vs none at (eval 7) line 1.

and this also popped up in the "perl Build test".
Google was to no avail.
 
I get the same warnings on Windows XP, Perl 5.10.0

Also, when I run my Perl script and the bot signs on to AIM, I get one of those "Perl Command Line Interpreter has encountered a problem and needs to close." errors from Windows.

I know Net::OSCAR has never given me trouble with Perl 5.8.8 but I haven't tested it on Perl 5.10.0 (with Windows anyway - runs fine in Linux).

The warnings don't seem to be the problem though. My program crashes when it tries to set callbacks.

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Nevermind, it crashes when I call signon().

The module might be broken for ActivePerl 5.10.0. Contact the author about it.

I have a really simplistic AIM bot that is known to work (so long as Net::OSCAR works) that you can use for testing at
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
I have some help!

I debugged the module and found exactly where my Perl was crashing at:

Net::OSCAR::Connection, around line 484 there's a line like this:

Code:
$self->set_blocking(0);

Commenting out this line allows my bot to run and sign on to AIM and respond to instant messages just fine.

A while back (it might've been the same version of Net::OSCAR or an older version), running it on Win32 would cause it to crash with the fatal error "Can't set Win32 blocking" - the "fix" was to change this error to be a warn instead of a die, and then the module would work fine.

So I'm guessing that Win32 has an issue with non-blocking sockets. And in this case the attempt by Net::OSCAR to make the socket non-blocking caused Perl to segfault on Win32.

This line appears in a few more places. Try commenting them out and see if you have any luck.

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Im using a modded version of an aim2irc.pl - used for Twitter updates and whatnot. I cant get past this error to look any further, really want some help.
 
Your aim2irc.pl script isn't the problem, you'll need to modify Net::OSCAR itself.

It's probably located at C:\Perl\site\lib\Net\OSCAR or C:\Perl\lib\Net\OSCAR - open the Connection.pm there in Wordpad and search for "$self->set_blocking", and comment out these lines by putting a # in front of them.

The warnings you got aren't critical. After I modded my copy of Net::OSCAR, my bot still gives me those warnings you got at the very beginning, but it still continues to sign on to AIM and respond to my messages (before, Perl would simply crash because of the nonblocking issue).

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
It said I couldnt save it, Access Denied, when i editted it.. I dont understand why. Im on Admin, Im not on Vista, I know my way around a computer but this is retarded :s
 
The file probably has the "read only" attribute, check its properties.

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Ya, I figured that out after posting. I editted Connection.pm in both directories you said, now its working, Thank you very much for your time and your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top