perl-获取网页内容报错Wide character in print at xx.pl或编码错误

本文为刘兴原创,转载请注意网址http://deepfuture.iteye.com

#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use 5.010;
use utf8;
open MYTXT,">mytet.txt";
binmode(MYTXT, ':encoding(utf8)');
my $url="http://www.hao123.com";
my $page=get($url);
print MYTXT $page;

binmode(STDOUT, ':encoding(utf8)');

say $page;

 

 

 

#注意红色部分,如果没有红色部分肯定报错:Wide character in print at

你可能感兴趣的:(perl)