in reply to Checking contents of fetched URL.

In addition, I'd like to point out it pretty much never makes sense to call ->content. You want
$res->decoded_content( charset => 'none' ) or $res->decoded_content()

The former returns the file the server returned as a string of bytes.

The latter returns the file the server returned as a string of characters, if possible. That is to say, it first removes the character encoding from text responses (text/plain, text/html, etc). Recent versions also remove the character encoding from XML responses (application/xml).