Mark Funk wrote:
>  
> Folks,
>  
> How do I read the response header information.
>  
> I am using LWP gets
...
>  my $response = $ua->get("$baseurl/$home");
>  $home_page = $response->as_string;
>  
> How would I code to read the Response headers?

Something like this should work:

print "Headers: \n";
my %hash = %{$response->headers};
print "\t$_ => $hash{$_}\n" foreach sort keys %hash;

# or

print "Headers_as_string: \n";
my @array = split "\n", $response->headers_as_string;
print "\t$_\n" foreach @array;

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to