in reply to Why would LWP::Simple::get stop working?

The behaviour of LWP changes based on whether the following returns zero or more than zero matches.

grep {lc($_) eq "http_proxy"} keys %ENV;

Has that changed recently? LWP::UserAgent isn't used for HTTP by LWP::Simple if that expression returns zero.

Replies are listed 'Best First'.
Re^2: Why would LWP::Simple::get stop working?
by dpmott (Scribe) on Jun 20, 2005 at 19:26 UTC
    Good thought, but alas...
    c:\>perl -e "@a=grep {/http/i} keys %ENV; print int @a" 0 c:\>

      Why "alas"? I indicated you might have started noticing the problem because of a change in that value, but you don't demonstrate a lack of change.

      What you did show is that you end up in LWP::Simple's _trivial_http_get method. (Usually, LWP calls end up LWP::UserAgent.) You could try adding debug statements to it. It could be that you end up in an endless redirection loop that LWP::UserAgent somehow avoids.

      btw, no problems here:

      >perl -le "print scalar grep {/http/i} keys %ENV" 0 >perl -le "use LWP (); print $LWP::VERSION" 5.64 >perl script.pl Fetching 'http://www.google.com' with LWP::UserAgent Retrieved 2311 bytes Fetching 'http://www.google.com' with LWP::Simple Retrieved 2311 bytes
        Alas, because I never have them set, so *any* values there would have represented a change. Sorry, in retrospect I didn't clearly state that I don't use any proxy here. So, zero keys meant to me that no proxy changes had bee instituted on my machine.