in reply to cpan & strawberry perl errors

Basically, why would LWP fail repeatedly from many sources most of the time but occassionally succeed?

What do you get if you try perl -S -MDevel::VersionDump lwp-request -UuSsEd url on some of those urls?

Replies are listed 'Best First'.
Re^2: cpan & strawberry perl errors
by BrowserUk (Patriarch) on Dec 31, 2014 at 10:34 UTC

    Notice that with LWP the redirect to pair.com fails with 500; but succeeds with wget. It looks for all the world like pair.com is rejecting LWP's useragent string?

    C:\test>perl -S -MDevel::VersionDump lwp-request -Ed http://cpan.straw +berryperl.com/authors/01mailrc.txt.gz Perl version: v5.18.4 on MSWin32 (C:\Perl5.18\perl\bin\perl.exe) Carp - 1.3301 Config - 5.018004 Config_git.pl - Unknown Config_heavy.pl - Unknown Devel::VersionDump - 0.02 DynaLoader - 1.18 Encode - 2.62 Encode::Alias - 2.18 Encode::Byte - 2.04 Encode::Config - 2.05 Encode::Encoding - 2.07 Encode::Locale - 1.03 Exporter - 5.70 Exporter::Heavy - 5.70 File::Basename - 2.84 Getopt::Long - 2.42 HTTP::Date - 6.02 HTTP::Status - 6.03 List::Util - 1.41 Scalar::Util - 1.41 Time::Local - 1.2300 URI - 1.64 URI::Escape - 3.31 URI::Heuristic - 4.20 Win32::API - 0.79 Win32::API::Struct - 0.65 Win32::API::Type - 0.69 XSLoader - 0.16 base - 2.18 bytes - 1.04 constant - 1.27 overload - 1.22 overloading - 0.02 strict - 1.07 vars - 1.03 warnings - 1.18 warnings::register - 1.02 GET http://cpan.strawberryperl.com/authors/01mailrc.txt.gz User-Agent: lwp-request/6.03 libwww-perl/6.08 302 Found Connection: close Date: Wed, 31 Dec 2014 10:30:00 GMT Location: http://cpan.pair.com/authors/01mailrc.txt.gz Server: Apache Vary: Accept-Encoding Content-Length: 228 Content-Type: text/html; charset=iso-8859-1 Client-Date: Wed, 31 Dec 2014 10:30:22 GMT Client-Peer: 69.163.152.144:80 Client-Response-Num: 1 Title: 302 Found GET http://cpan.pair.com/authors/01mailrc.txt.gz User-Agent: lwp-request/6.03 libwww-perl/6.08 500 Can't connect to cpan.pair.com:80 Content-Type: text/plain Client-Date: Wed, 31 Dec 2014 10:30:22 GMT Client-Warning: Internal response C:\test>wget http://cpan.pair.com/authors/01mailrc.txt.gz --2014-12-31 10:31:47-- http://cpan.pair.com/authors/01mailrc.txt.gz Resolving cpan.pair.com... 66.39.76.93 Connecting to cpan.pair.com|66.39.76.93|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 228720 (223K) [application/x-gzip] Saving to: `01mailrc.txt.gz' 100%[=====================>] 228,720 240K/s in 0.9s 2014-12-31 10:31:49 (240 KB/s) - `01mailrc.txt.gz' saved [228720/22872 +0] C:\test>

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      d'oh, that doesnt give LWP version info ... seems to work here just fine
      $ perl -S -MDevel::ModuleDumper lwp-download http://cpan.strawberryper +l.com/authors/01mailrc.txt.gz Saving to '01mailrc.txt.gz'... 223 KB received in 0 seconds (288 KB/sec) Perl 5.016001 Compress::Raw::Zlib 2.063 Encode 2.55 Encode::Alias 2.18 Encode::Byte 2.04 Encode::Config 2.05 Encode::Encoding 2.07 Encode::Locale 1.03 Errno 1.15 Fcntl 1.11 File::Basename 2.84 File::Glob 1.17 File::GlobMapper 1.000 Getopt::Std 1.07 HTML::Entities 3.69 HTML::HeadParser 3.69 HTML::Parser 3.7 HTTP::Config 6.00 HTTP::Date 6.02 HTTP::Headers 6.05 HTTP::Message 6.06 HTTP::Request 6.00 HTTP::Response 6.04 HTTP::Status 6.03 IO 1.25_06 IO::Compress::Base::Common 2.063 IO::Compress::Gzip::Constants 2.063 IO::Compress::Zlib::Extra 2.063 IO::File 1.16 IO::Handle 1.33 IO::Seekable 1.1 IO::Socket 1.34 IO::Socket::INET 1.33 IO::Socket::IP 0.31 IO::Socket::UNIX 1.24 IO::Uncompress::Adapter::Inflate 2.063 IO::Uncompress::Base 2.063 IO::Uncompress::Gunzip 2.063 IO::Uncompress::RawInflate 2.063 List::Util 1.33 LWP 6.08 LWP::ConnCache 6.02 LWP::MediaTypes 6.02 LWP::MemberMixin none LWP::Protocol 6.06 LWP::Protocol::http none LWP::UserAgent 6.06 Net::HTTP 6.07 Net::HTTP::Methods 6.07 POSIX 1.30 Scalar::Util 1.33 SelectSaver 1.02 Socket 2.006 Storable 2.39 Symbol 1.07 Tie::Hash 1.04 Time::Local 1.2300 URI 1.60 URI::Escape 3.31 URI::http none URI::_generic none URI::_idna none URI::_punycode 0.04 URI::_query none URI::_server none Win32::API 0.75 Win32::API::Struct 0.64 Win32::API::Type 0.67 Win32::Console 0.09

        Does this fill in the blanks?:

        C:\test>perl -MLWP -MDevel::VersionDump -e1 Perl version: v5.18.4 on MSWin32 (C:\Perl5.18\perl\bin\perl.exe) Bareword found where operator expected at (eval 7) line 1, near "18::p +erl::lib::auto::Log::Agent::Priorities::autosplit" (Missing operator before ::perl::lib::auto::Log::Agent::Priori +ties::autosplit?) Bareword found where operator expected at (eval 8) line 1, near "18::p +erl::lib::auto::Log::Agent::autosplit" (Missing operator before ::perl::lib::auto::Log::Agent::autosp +lit?) AutoLoader - + 5.74 C:::perl5.18::perl::lib::auto::Log::Agent::Priorities::autosplit.ix - + Unknown C:::perl5.18::perl::lib::auto::Log::Agent::autosplit.ix - + Unknown Carp - + 1.3301 Config - +5.018004 Devel::VersionDump - + 0.02 Exporter - + 5.70 Exporter::Heavy - + 5.70 Fcntl - + 1.11 HTTP::Date - + 6.02 HTTP::Headers - + 6.05 HTTP::Message - + 6.06 HTTP::Request - + 6.00 HTTP::Response - + 6.04 HTTP::Status - + 6.03 LWP - + 6.08 LWP::MemberMixin - + Unknown LWP::Protocol - + 6.06 LWP::UserAgent - + 6.06 Log::Agent - + 1 Log::Agent::Formatting - + Unknown Log::Agent::Message - + Unknown Log::Agent::Priorities - + Unknown Storable - + 2.51 Time::Local - + 1.2300 URI - + 1.64 URI::Escape - + 3.31 XSLoader - + 0.16 constant - + 1.27 overload - + 1.22 overloading - + 0.02 strict - + 1.07 vars - + 1.03 warnings - + 1.18 warnings::register - + 1.02

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        In case not:

        C:\test>perl -S -MDevel::ModuleDumper lwp-download http://cpan.strawbe +rryperl.com/authors/01mailrc.txt.gz lwp-download: 500 Can't connect to cpan.strawberryperl.com:80 Perl 5.018004 Carp 1.3301 Encode 2.62 Encode::Alias 2.18 Encode::Byte 2.04 Encode::Config 2.05 Encode::Encoding 2.07 Encode::Locale 1.03 Errno 1.18 Exporter 5.70 Exporter::Heavy 5.70 Fcntl 1.11 File::Basename 2.84 Getopt::Std 1.07 HTTP::Config 6.00 HTTP::Date 6.02 HTTP::Headers 6.05 HTTP::Message 6.06 HTTP::Request 6.00 HTTP::Response 6.04 HTTP::Status 6.03 IO 1.28 IO::Handle 1.34 IO::Socket 1.36 IO::Socket::INET 1.33 IO::Socket::IP 0.32 IO::Socket::UNIX 1.24 List::Util 1.41 Log::Agent 1 Log::Agent::Formatting none Log::Agent::Message none Log::Agent::Priorities none LWP 6.08 LWP::ConnCache 6.02 LWP::MediaTypes 6.02 LWP::MemberMixin none LWP::Protocol 6.06 LWP::Protocol::http none LWP::UserAgent 6.06 Net::HTTP 6.07 Net::HTTP::Methods 6.07 POSIX 1.32 Scalar::Util 1.41 SelectSaver 1.02 Socket 2.015 Storable 2.51 Symbol 1.07 Tie::Hash 1.04 Time::Local 1.2300 URI 1.64 URI::Escape 3.31 URI::http none URI::_generic none URI::_query none URI::_server none Win32::API 0.79 Win32::API::Struct 0.65 Win32::API::Type 0.69

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.