in reply to perl lwp

Your code is fine; the problem is with the URL. In general, when testing this sort of code, check the validity of the URL before assuming a problem with your Perl code. What do you get when you plug that URL into a browser?

Removing the "1" (i.e. my $url='http://www.google.com/';) gives:

New url :http://www.google.com/ Response Headers: Cache-Control: private, max-age=0 Date: Tue, 07 Feb 2012 11:20:59 GMT Server: gws Content-Type: text/html; charset=ISO-8859-1 ...

If you think the URL you provided should be valid, contact Google for a reason why it's not available.

-- Ken

Replies are listed 'Best First'.
Re^2: perl lwp
by perl_sakthe (Initiate) on Feb 08, 2012 at 05:21 UTC
    Hi, thanks for the reply.. I am able to get the contents of our application url.. For the current requirement I need to get the xml content from an external url.. from my perl script, I am not able to get any other url's content...should i check any firewall or proxy.. when i run the perl script for any other url , i am getting the result as, HTTP/0.9 200 (OK) EOF Client-Date: Wed, 08 Feb 2012 05:13:58 GMT Client-Peer: 66.39.54.27:80 Client-Response-Num: 1 Can you please suggest..

      Your code works when I run it and I can access external content so I can't reproduce your problem. I suggest you check with your local system/network administrators or whoever manages such tasks.

      -- Ken