- 论坛徽章:
- 0
|
if($response->is_success){
my $content=$response->content;
$content=decode('gbk',$content);
#$content=~/.*?请尽快到<(.*)>检查邮件并操作.*/;
#my $mail=$1;
if ($content=~/.*?请尽快到<(.*)>检查邮件并操作.*/){
$mail_list{$id}=$user;
print "写入用户 u 的邮件 1 到文件,完成\n";
$u=encode('utf8',$u);
print ML "$u\t$id\t$1\n";
return 1;
}else{
if($content=~/.*?找不到您输入的用户名.*/){
print "该用户".$u."不存在\n";
}elsif($content=~/.*?本论坛设置了一个小时之内同一个帐号只能发送一次密码找回邮件.*/){
print "用户".$u."在一小时内只能提交一次\n";
}else{
print "获取用户 $u 出错\n";
}
return 0;
}
}else{
print "获取当前用户邮件地址失败,失败原因:".$response->status_line;
return 0;
}
网页返回内容编码为“x-gbk",这里比较奇怪,不知道x-gbk和gbk是什么区别,只能按gbk来decode了。
匹配汉字可以匹配到,但问题是屏幕上报了许多警告:
Malformed UTF-8 character (overflow at 0x81bcaf2f, byte 0x54, after start byte 0xbf) in pattern match (m//) at ./catch_mail.pl line 76.
Malformed UTF-8 character (overflow at 0x81bcaf2f, byte 0x54, after start byte 0xbf) in pattern match (m//) at ./catch_mail.pl line 76.
如何才能让匹配不报警告,或者说如何不显示警告呢,谢谢! |
|