I'm facing an issue while getting the actual contents of fetched URL. My requirement is to hit certain URL check its content if it contains correct search string in it or not. But I'm getting HASH code in the content. Following is the sample code snippet.
## set URL
my $url = "http://google.com";
my $ua = LWP::UserAgent->new();
my $res = $ua->get($url);
my $response = $res->content;
print "Response Type = ".$res->content_type;
print "\nResponse Status ".$res->status_line." Res code ";
print "\nResponse = $res->content \n";
Following is the Result I'm getting from above code.
Response Type = text/html
Response Status 200 OK Res code
Response = HTTP::Response=HASH(0x8401064)->content
How can I get the actual text content?