Perl printing to system

A

Aielman

I am trying to set up LWP to work with sockets. I am currently using
the use LWP::protocol::http::SocksChain module to connect. The connect
works fine, however I can't get the IO::Socket::INET that it calls to
stop printing outputs when the connection fails.

22/06 12:18:30 [ 07505 : 1005 ] : IO::Socket::INET: connect: Connection
refused
22/06 12:18:30 [ 07505 : 1005 ] : Can't create network socket... :
Connection refused

Is there anyway to squelch outputs to the system? Or someway to get
IO::Socket::INET to stop making the system print outs?

use LWP::UserAgent;
use LWP::protocol::http::SocksChain;
LWP::protocol::implementor( http => 'LWP::protocol::http::SocksChain'
);

@LWP::protocol::http::SocksChain::EXTRA_SOCK_OPTS = (
Chain_Len => 1,
Debug => 0,
Random_Chain => 1,
Chain_File_Data => ['vpn1.findnot.com:1088:XXXXXX:XXXXXXX:5',],
Auto_Save => 0,
Restore_Type => 0 );

&socket();

sub socket{

my $ua = LWP::UserAgent->new();

my $res =
$ua->get('http://www.samair.ru/proxy/proxychecker/results.htm');

if ($res->is_success) {
print $res->content;
} else {
print "failed";
}
}
 
X

xhoster

Aielman said:
I am trying to set up LWP to work with sockets. I am currently using
the use LWP::protocol::http::SocksChain module to connect. The connect
works fine, however I can't get the IO::Socket::INET that it calls to
stop printing outputs when the connection fails.

22/06 12:18:30 [ 07505 : 1005 ] : IO::Socket::INET: connect: Connection
refused
22/06 12:18:30 [ 07505 : 1005 ] : Can't create network socket... :
Connection refused

I don't think IO::Socket::INET is printing this message. It is merely
returning the message in $@ and/or $!, and some other module
(LWP::protocol::http::SocksChain or Net::SC) is doing the printing.


Net::SC has a LOG_FILE option that may help you.

Xho
 
M

Matt Garrish

Aielman said:
I am trying to set up LWP to work with sockets. I am currently using
the use LWP::protocol::http::SocksChain module to connect. The connect
works fine, however I can't get the IO::Socket::INET that it calls to
stop printing outputs when the connection fails.

22/06 12:18:30 [ 07505 : 1005 ] : IO::Socket::INET: connect: Connection
refused
22/06 12:18:30 [ 07505 : 1005 ] : Can't create network socket... :
Connection refused

Is there anyway to squelch outputs to the system? Or someway to get
IO::Socket::INET to stop making the system print outs?

use LWP::UserAgent;
use LWP::protocol::http::SocksChain;
LWP::protocol::implementor( http => 'LWP::protocol::http::SocksChain'
);

@LWP::protocol::http::SocksChain::EXTRA_SOCK_OPTS = (
Chain_Len => 1,
Debug => 0,
Random_Chain => 1,
Chain_File_Data => ['vpn1.findnot.com:1088:XXXXXX:XXXXXXX:5',],
Auto_Save => 0,
Restore_Type => 0 );

Setting debug as you have above outputs "failed". Only if I set it to 1 do I
get the messages you noted above (as expected).

Using SocksChain.pm v. 1.3 and ActivePerl 5.8.8 Build 817.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top