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";
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.