How can I handle proxies using LWP :: Simple?

How can I add proxy support for this script?

use LWP::Simple;

$url = "http://stackoverflow.com";
$word = "how to ask";
$content = get $url;
if($content =~ m/$word/)
{
print "Found $word";
}
+3
source share
1 answer

Access to the LWP :: UserAgent base object and proxy settings. LWP :: Simple exports the variable $uaso you can do this:

use LWP :: Simple qw ($ ua get);
$ ua-> proxy ('http', 'http://myproxy.example.com');
my $ content = get ('http://www.example.com/');
+12
source

Source: https://habr.com/ru/post/1703124/