http://www.perlmonks.org?node_id=792834


in reply to Re^5: LWP - 500 Internal Error
in thread LWP - 500 Internal Error

Thanks again,

I tried the script, adding the dump line again and it came back with the following results

A successfull 200 OK comes out like this

E:\ovXtras\SCRIPTING>debugurltestv5.pl http://www.elm.com.sa http://192.168.5.5:8080/ 200 OK Err : (9)(Bad file descriptor)(0)() Can't locate object method "dump" via package "HTTP::Headers" at (eval + 28) line 1.

while an unsuccessful attempt has some additional info

E:\ovXtras\SCRIPTING>debugurltestv5.pl https://www.ehealth.com.sa http://192.168.5.5:8080/ 500 Internal Server Error Err : (9)(Bad file descriptor)(10038)(An operation was attempted on so +mething that is not a socket) Can't locate object method "dump" via package "HTTP::Headers" at (eval + 28) line 1.

Can anything be concluded from this?

My present code below

# !C:\Perl\bin use strict; use warnings; use LWP::UserAgent; #@ARGV = qw[ http://www.eserve.com.sa/ ]; my $url = shift or die "URL expected\n"; my $useragent = LWP::UserAgent->new; $useragent->proxy(['http', 'ftp','https'], 'http://192.168.5.5:8080/') +; $useragent -> timeout( 20 ); my $request = HTTP::Request->new( GET => $url ); my $response = $useragent->request($request); my $err = sprintf "(%d)(%s)(%d)(%s)\n", $!,$!,$^E,$^E; print $useragent->proxy('http'),"\n"; print $response->status_line, "\n"; print "Err : $err \n"; print $response->dump,"\n";

Replies are listed 'Best First'.
Re^7: LWP - 500 Internal Error
by Anonymous Monk on Sep 02, 2009 at 07:57 UTC
    You should have tried that ages ago. And you should have tried this
    lwp-request -useUS -m head http://www.eserve.com.sa/ lwp-request -useUS -m get http://www.eserve.com.sa/
    ages ago. You should upgrade LWP to the latest version.
      The outputs for these two commands are as follows:
      C:\Documents and Settings\HP-OVE-User>lwp-request -useUS -m head http: +//www.eser ve.com.sa Use of uninitialized value $scheme in hash element at C:/Program Files +/Perl/lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:/Progra +m Files/Pe rl/lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:/Program Files/Perl/lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:/Program Files/Pe +rl/lib/LWP /UserAgent.pm line 199. HEAD http://www.eserve.com.sa User-Agent: lwp-request/5.810 HEAD http://www.eserve.com.sa --> 501 Protocol scheme '' is not suppor +ted Content-Type: text/plain Client-Date: Wed, 02 Sep 2009 11:21:49 GMT Client-Warning: Internal response C:\Documents and Settings\HP-OVE-User>lwp-request -useUS -m get http:/ +/www.eserv e.com.sa Use of uninitialized value $scheme in hash element at C:/Program Files +/Perl/lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:/Progra +m Files/Pe rl/lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:/Program Files/Perl/lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:/Program Files/Pe +rl/lib/LWP /UserAgent.pm line 199. GET http://www.eserve.com.sa User-Agent: lwp-request/5.810 GET http://www.eserve.com.sa --> 501 Protocol scheme '' is not support +ed Content-Type: text/plain Client-Date: Wed, 02 Sep 2009 11:21:54 GMT Client-Warning: Internal response 501 Protocol scheme '' is not supported

      As for LWP, I presently have version 5.814

      I've tried upgrading using cpan, but since its already a network issue I'm troubleshooting, I get stuck ... it says I have the latest version, probably because it couldn't connect

      cpan> install Bundle::LWP Fetching with LWP: http://ppm.activestate.com/CPAN/authors/01mailrc.txt.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] Fetching with LWP: http://cpan.perl.org/authors/01mailrc.txt.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] No external ftp command available I would like to connect to one of the following sites to get 'authors/ +01mailrc.t xt.gz': http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/ Is it OK to try to connect to the Internet? [yes] Fetching with LWP: http://www.perl.org/CPAN/authors/01mailrc.txt.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53, <STDIN> line 1. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56, <STDIN> line 1. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36, <STDIN> line 1. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199, <STDIN> line 1. LWP failed with code[501] message[Protocol scheme '' is not supported] Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz LWP failed with code[500] message[LWP::Protocol::MyFTP: connect: timeo +ut] Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz Could not connect to host 'ftp.perl.org' with Net::FTP Fetching with Net::FTP ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz.gz Could not connect to host 'ftp.perl.org' with Net::FTP No external ftp command available Please check, if the URLs I found in your configuration file (http://ppm.activestate.com/CPAN, http://cpan.perl.org) are valid. The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/' Could not fetch authors/01mailrc.txt.gz Fetching with LWP: http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] Fetching with LWP: http://cpan.perl.org/modules/02packages.details.txt.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] No external ftp command available Fetching with LWP: http://www.perl.org/CPAN/modules/02packages.details.txt.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz LWP failed with code[500] message[LWP::Protocol::MyFTP: connect: timeo +ut] Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz Could not connect to host 'ftp.perl.org' with Net::FTP Fetching with Net::FTP ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz.gz Could not connect to host 'ftp.perl.org' with Net::FTP No external ftp command available Please check, if the URLs I found in your configuration file (http://ppm.activestate.com/CPAN, http://cpan.perl.org) are valid. The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/' Could not fetch modules/02packages.details.txt.gz Fetching with LWP: http://ppm.activestate.com/CPAN/modules/03modlist.data.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] Fetching with LWP: http://cpan.perl.org/modules/03modlist.data.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] No external ftp command available Fetching with LWP: http://www.perl.org/CPAN/modules/03modlist.data.gz Use of uninitialized value $scheme in hash element at C:\Program Files +\Perl\lib/ LWP/Protocol.pm line 53. Use of uninitialized value $scheme in pattern match (m//) at C:\Progra +m Files\Pe rl\lib/LWP/Protocol.pm line 56. Use of uninitialized value $scheme in concatenation (.) or string at C +:\Program Files\Perl\lib/LWP/Protocol.pm line 36. Use of uninitialized value $scheme in string eq at C:\Program Files\Pe +rl\lib/LWP /UserAgent.pm line 199. LWP failed with code[501] message[Protocol scheme '' is not supported] Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz LWP failed with code[500] message[LWP::Protocol::MyFTP: connect: timeo +ut] Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz Could not connect to host 'ftp.perl.org' with Net::FTP Fetching with Net::FTP ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz.gz Could not connect to host 'ftp.perl.org' with Net::FTP No external ftp command available Please check, if the URLs I found in your configuration file (http://ppm.activestate.com/CPAN, http://cpan.perl.org) are valid. The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/' Could not fetch modules/03modlist.data.gz Going to write C:\Program Files\Perl\cpan\Metadata MIME::Base64 is up to date (3.07_01). Digest::MD5 is up to date (2.36_01). URI is up to date (1.37). Net::FTP is up to date (2.77). HTML::Tagset is up to date (3.20). HTML::Parser is up to date (3.56). HTML::HeadParser is up to date (2.22). LWP is up to date (5.814).

      Is there a clearcut manual way to install it including all the prerequisistes. I mean, where can I download a newer version from, I seem to have found only the present versionn in my searched