I am trying to user perl to read a text file online, using a call like this:
$output = $ua->request($req)->as_string;
The problem is that output has a lot of garbage in it that I don’t want, e.g.
HTTP/1.1 200 OK
Connection: close
Date:
etc...
Is there a way to truncate the output so I get only the contents of the file?
The problem is you are simply getting the response object from
LWP::UserAgentand just dumping it as a string. If you want to get just the content:It’s all there in black and white: https://metacpan.org/pod/HTTP::Request