如何使HTML :: Clean模塊在此perl腳本中起作用。Perl HTML清理
#!/usr/bin/env perl
use strict;
use warnings;
require LWP::UserAgent;
open FH, "<", "text.txt";
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
foreach my $line (<FH>) {
my $response = $ua->get($line);
my $h = new HTML::Clean(\$response);
if ($response->is_success) {
print $response->decoded_content;
}
else {
die $response->status_line;
}
}
close FH;
確切地說,你期望HTML :: Clean能爲你做什麼?您似乎對您創建的對象沒有任何作用。 –