测试关闭mojo utf-8
2016-06-30 20:11
260 查看
[root@wx03 ~]# cat test.pl use Mojolicious::Lite; use JSON qw/encode_json decode_json/; use Encode; no strict; use JSON; use Data::Dumper; no utf8; # /foo?user=sri get '/admin/api/menu' => sub { my $c = shift; print "测试更健康\n"; open (LOG1 ,"<",'/data01/applog_backup/zj-api01-catalina.out') or die $!; while (<LOG1>) { my $phone='18072722237'; #2016-03-09 09:35:12,380 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为132435,本验证码5分钟内有效。 to phoneNo:18072722237 succeed! if ( ($phone) and ($_ =~/$phone/) and ($_ =~/SMSUtils/) ){$str=$_; # my $d=encode_utf8('验证'); my $d='验证'; print "1-------\$str is $str\n"; next if ($str !~ /$d/); print "2--------\$str is $str\n"; push (@arr1 ,decode_utf8($str)); }}; close LOG1; $c->render(json => \@arr1 ); }; app->start; 接口返回: [root@wx03 ~]# morbo test.pl Server available at http://127.0.0.1:3000 [Thu Jun 30 20:09:34 2016] [debug] GET "/admin/api/menu" [Thu Jun 30 20:09:34 2016] [debug] Routing to a callback 测试更健康 1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed! 2--------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed! 1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分钟内有效。 to phoneNo:18072722237 succeed! 1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分钟内有效。 to phoneNo:18072722237 succeed! [Thu Jun 30 20:09:34 2016] [debug] 200 OK (0.001106s, 904.159/s) [root@wx03 ~]# curl http://120.55.xx.6:3000/admin/api/menu ["2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed!\n"][root@wx03 ~]#
相关文章推荐
- 2016. 7.1
- Python 核心编程笔记_Chapter_6_Note_2 字符串的内建函数zip_转义字符_字符串术语
- 数据挖掘过程总结
- 测试关闭mojo utf-8
- 测试关闭mojo utf-8
- iOS 视频播放的简单使用
- junit4xi注释详解
- xlistview_header.xml
- Kakfa揭秘 Day5 SocketServer下的NIO
- 51 NOD 1138 连续整数的和(简单数学公式)
- ROS在ARDUINO的应用
- HDU 1236 排名 Java实现
- 今天终于下定决心报了老男孩linux运维就业班
- SIFT特征
- maven打包
- 搜索框组件
- GMap.Net开发之在地图上添加多边形
- web攻击手段(二)CRSF
- xlistview_footer.xml
- 上位机和软件、触摸屏、人机界面组态软件、人机界面控制板、工控机、VGA控制板、TFT-LCD串...