perl 网页编码转换

use Encode;
use LWP::Simple qw(get);
use HTTP::Date qw(time2iso str2time time2iso time2isoz);
use Net::Ping;
use Socket;
use Net::SMTP;


$host = 'http://www.xxx.cn';
@content = get($host);
while (<@content>) {
$str = encode("gbk",decode("utf8","$_"));
print "$str" ;
}
close FILE;

你可能感兴趣的:(perl 网页编码转换)