Gangabass has asked for the wisdom of the Perl Monks concerning the following question:

Hi, monks

Can you explain me what's i'm doing wrong?

This simple script did't work :-(. The error is:

IO::Socket::INET: connect: Unknow error
Can't create network socket... : Unknown error

Here is script

use LWP::UserAgent; use LWP::Protocol::https::SocksChain; LWP::Protocol::implementor( https => 'LWP::Protocol::https::SocksChai +n' ); @LWP::Protocol::https::SocksChain::EXTRA_SOCK_OPTS = ( Chain_Len => 1, Debug = +> 0, Chain_File_Dat +a => [ '83.22.135. +115:17789:::4', '24.149.242 +.242:41801:::4', '86.127.20.42:36049:::4', '66.177.248.75:10837:::4', '59.93.169.9:8245:::4', '210.4.173.38:25455:::4', '219.168.197.20:47173:::4', '77.100.137.238:49521:::4', '69.204.162.135:14709:::4', '125.63.81.166:3515:::4', '68.144.4.255:4973:::4', '24.96.247.90:11049:::4', '68.206.160.167:57311:::4', '89.155.126.178:7631:::4', '83.22.135.115:17789:::4', '97.81.225.223:58661:::4', '76.241.72.129:48733:::4', '72.225.37.251:52673:::4', '71.196.173.197:3793:::4', '61.2.28.188:28215:::4', '24.149.242.242:41801:::4', '24.198.93.212:9903:::4', '87.94.87.111:39855:::4', ], Auto_Save => 0, Restore_Type => 0 ); my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new( GET => 'https://www.paypal.com/'); my $res = $ua->request($req) || die $!; if ($res->is_success) { print "OK!\n"; } else { print "Not OK!\n"; print $res->as_string(); }

Replies are listed 'Best First'.
Re: Problem with LWP::Protocol::https::SocksChain
by Anonymous Monk on Sep 03, 2007 at 11:47 UTC
    print $^E,$/;

      This is LWP::Protocol::https::SocksChain internal error so i don't know there i must put

      print $^E

        Assuming you are on Win32, the whenever print $! reports Unknown error, printing $^E may give you so called "extended error information", ie. the actual win32 error text rather than perl's half hearted attempt to convert every system error to one of the 3 (or is it 5?) catch all POSIX error codes.

        In this case, (I'm guessing as your error messages to do not show the line numbersfrom which they originate), that if you added it to the following:

        my $res = $ua->request($req) || die $!, $^E;

        You might get more information about whatthe problem is.


        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.