将网页源代码下载到Perl中的字符串

Vla*_*tch 1 perl

我该怎么做?

我还想使用代理.我怎么做?

Blu*_*ind 5

use WWW::Mechanize;

my $mech = WWW::Mechanize->new();
$mech->get("http://foo.com/bar");
my $content = $mech->res()->content();
Run Code Online (Sandbox Code Playgroud)

有关代理,请参阅Mechanize常见问题解答.