in reply to LWP::UserAgent not finishing get requests?

I'd start by eliminating variables. Specifically, comment out $ua->timeout(10); and $ua->env_proxy;.

even as_string() all return blank.

That's impossible! HTTP::Response objects are guaranteed to return "000 Unknown code" at the very least.

sub status_line { my $self = shift; my $code = $self->{'_rc'} || "000"; my $mess = $self->{'_msg'} || HTTP::Status::status_message($code) +|| "Unknown code"; return "$code $mess"; } sub as_string { require HTTP::Status; my $self = shift; my($eol) = @_; $eol = "\n" unless defined $eol; my $status_line = $self->status_line; my $proto = $self->protocol; $status_line = "$proto $status_line" if $proto; return join($eol, $status_line, $self->SUPER::as_string(@_)); }

And besides, we know that _rc is ≥200 and <300 because is_success returned true.

Replies are listed 'Best First'.
Re^2: LWP::UserAgent not finishing get requests?
by ttlgreen (Sexton) on Jan 17, 2009 at 02:01 UTC
    This is a total guess... but maybe it's empty because the response isn't actually getting back from the server?

    Those darn RST packets coming from my script for no apparent reason seem to do their job well...

      Look at the code I pasted. No matter what the object contains, $response->as_string will always return something. And by your own testimony, is_success returns true so it's not empty.
        Well it looks like I'm the idiot here. :(

        I just did another as_string since you're right it REALLY shouldn't be empty.

        It did in fact contain the headers and then this X-Died: Can't locate HTML/HeadParser.pm in @INC

        Looks like that's the problem. I _swear_ on my sanity (yikes) that as_string returned blank yesterday. Maybe I'm dilusional...

        Thanks, and sorry for wasting your time!

        EDIT: Well at least I'm not a total idiot ;) I did in fact have the HeadParser module installed, but apparently it was broken because I just reinstalled it and everything works as expected. I hate computers...