in reply to perl lwp

You're programming much too complicated. Do read the documentation of the software you are working with: LWP::UserAgent, chapter REQUEST METHODS. There is a convenience method get.
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent 6; my $url = 'http://www.perlmonks.org/'; my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout +=> 30); my $res = $ua->get($url); if ($res->is_success) { print "New URL: $url\n"; print "Response Headers:\n"; print $res->headers_as_string; print '='x70, "\n", $res->as_string, '='x70, "\n"; print "Content_type:" . $res->content_type . "\n"; } else { print "No success\n"; print $res->status_line . "\n"; }

Replies are listed 'Best First'.
Re^2: perl lwp
by perl_sakthe (Initiate) on Feb 08, 2012 at 05:16 UTC
    Hi, Even with this code, 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 There is not content. Should i check for any firewall issues or any proxy setting.. i am running from my unix sevrer.. should any permissions be granted.. Because I am able to get the contents of only our application url.. other than that I am not able to hit any external url.. Can you please suggest