Hi all, I've been using a Perl script for a couple of years to retrieve FaceBook event listings. It's worked fine until the last couple of months, and I'm very often getting this message:

Status read failed: A non-blocking socket operation could not be completed immediately. at C:/Strawberry/perl/vendor/lib/Net/HTTP/Methods.pm line 276.

I've searched around and couldn't find anything that explains what this means or what to do about it. Oddly, once in a while the script still works.

Here's a bit of my login code. I'm running on Windows 7 with Strawberry Perl v5.20.2.

use CGI; use File::Basename; use LWP::UserAgent; use strict; my %postLoginData; #necessary post data for login $postLoginData{'email'}=$email; $postLoginData{'pass'}=$password; $postLoginData{'persistent'}=1; $postLoginData{'login'}='Login'; our $response; #holds the response the HTTP requests #set the headers, let's make this a Firefox browser! our @header = ('Referer'=>'http://www.facebook.com', 'User-Agent'=>$us +er_agent); our $cookie_jar = HTTP::Cookies->new(file=>'fbkCookies.dat',autosave=> +1, ignore_discard=>1); our $browser = LWP::UserAgent->new; #init browser $browser->cookie_jar($cookie_jar); print " getting fb login...\n"; $browser->get('http://www.facebook.com/login.php',@header); print " posting login request...\n"; #here we actually login! $response = $browser->post('https://login.facebook.com/login.php',\%po +stLoginData,@header); #was login successful? if($response->content =~ /Incorrect Email/) { print "Login Failed...Quitting..\n"; exit; } else { print "..and we are in!\n\n"; #let's go to the homepage my $pageresponse = $browser->get( $url ,@header); # this is where the error appears: print $$pageresponse{_content};

I know there are FB modules out there that probably work better, but I'd like to understand what's happening here, if anyone has seen it before. Many thanks!


In reply to A non-blocking socket operation could not be completed ? by slugger415

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.