in reply to Using LWP::UserAgent to Get Web Pages

To learn more about the cause of the error the following will get you more verbose output from LWP:
use LWP::Debug qw(+);

My hinch is that this is either related to your DNS settings or to security settings on your system.

Try to 'ping' google to check your DNS settings.
If that works fine then check that the ping cmd also works in the context of a cgi environment executed by your webserver (e.g. include with backticks in a cgi perl prog).