in reply to grab HTTP Response and Headers

I think you want to replace:
$results = $ua->request($req)->as_string; #grab the results
with:
$results = $ua->request($req)->headers_as_string; #grab the results
When I ran your snippet, it printed out the whole response, not just the headers.

update: I used this in the past:
use strict; use LWP::Simple qw(get head); my $url = 'http://www.w3c.org'; print head($url)->{_headers}->as_string;


Error: Keyboard not attached. Press F1 to continue.