in reply to Re^6: WGET equivalent
in thread WGET equivalent

Not mysterious. LWP::UserAgent does not set $!. The "permission denied" message you're seeing is just an artifact of $! having some value resulting from some system call.

I recommend using $response->as_string() to inspect what you get back, and

die $response->status_line;

(as the documentation of HTTP::Response suggests).