mojo 关闭utf8
生活随笔
收集整理的這篇文章主要介紹了
mojo 关闭utf8
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
[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=sriget '/admin/api/menu' => sub {my $c = shift;print "測(cè)試更健康\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:您的驗(yàn)證碼為132435,本驗(yàn)證碼5分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!if ( ($phone) and ($_ =~/$phone/) and ($_ =~/SMSUtils/) ){$str=$_;# my $d=encode_utf8('驗(yàn)證');my $d='驗(yàn)證';print "1-------\$str is $str\n";next if ($str !~ /$d/);print "2--------\$str is $str\n";push (@arr1 ,$str);}};close LOG1;$c->render(text => "測(cè)試更健康" );
};app->start;此時(shí)接口返回;[root@wx03 ~]# morbo test.pl Server available at http://127.0.0.1:3000
[Thu Jun 30 19:50:58 2016] [debug] GET "/admin/api/menu"
[Thu Jun 30 19:50:58 2016] [debug] Routing to a callback
Wide character in print at /root/test.pl line 11.
測(cè)試更健康
1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的驗(yàn)證碼為813231,本驗(yàn)證碼30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本驗(yàn)證碼30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本驗(yàn)證碼30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed![Thu Jun 30 19:50:58 2016] [debug] 200 OK (0.00104s, 961.538/s)/******[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=sriget '/admin/api/menu' => sub {my $c = shift;print "測(cè)試更健康\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:您的驗(yàn)證碼為132435,本驗(yàn)證碼5分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!if ( ($phone) and ($_ =~/$phone/) and ($_ =~/SMSUtils/) ){$str=$_;my $d=encode_utf8('驗(yàn)證');# my $d='驗(yàn)證';print "1-------\$str is $str\n";next if ($str !~ /$d/);print "2--------\$str is $str\n";push (@arr1 ,$str);}};close LOG1;$c->render(text => "測(cè)試更健康" );
};app->start;[root@wx03 ~]# morbo test.pl
Server available at http://127.0.0.1:3000
[Thu Jun 30 19:52:38 2016] [debug] GET "/admin/api/menu"
[Thu Jun 30 19:52:38 2016] [debug] Routing to a callback
Wide character in print at /root/test.pl line 11.
測(cè)試更健康
1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的驗(yàn)證碼為813231,本驗(yàn)證碼30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!2--------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的驗(yàn)證碼為813231,本驗(yàn)證碼30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed![Thu Jun 30 19:52:38 2016] [debug] 200 OK (0.001048s, 954.198/s)/************ 關(guān)閉utf-8[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=sriget '/admin/api/menu' => sub {my $c = shift;print "測(cè)試更健康\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:您的驗(yàn)證碼為132435,本驗(yàn)證碼5分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!if ( ($phone) and ($_ =~/$phone/) and ($_ =~/SMSUtils/) ){$str=$_;# my $d=encode_utf8('驗(yàn)證');my $d='驗(yàn)證';print "1-------\$str is $str\n";next if ($str !~ /$d/);print "2--------\$str is $str\n";push (@arr1 ,$str);}};close LOG1;$c->render(text => "測(cè)試更健康" );
};app->start;接口返回;[root@wx03 ~]# morbo test.pl
Server available at http://127.0.0.1:3000
[Thu Jun 30 19:55:09 2016] [debug] GET "/admin/api/menu"
[Thu Jun 30 19:55:09 2016] [debug] Routing to a callback
測(cè)試更健康
1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的驗(yàn)證碼為813231,本驗(yàn)證碼30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!2--------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的驗(yàn)證碼為813231,本驗(yàn)證碼30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分鐘內(nèi)有效。 to phoneNo:18072722237 succeed![Thu Jun 30 19:55:09 2016] [debug] 200 OK (0.001001s, 999.001/s)
轉(zhuǎn)載于:https://www.cnblogs.com/zhaoyangjian724/p/6199751.html
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專(zhuān)家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的mojo 关闭utf8的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 从tabBarController的一个
- 下一篇: sqlmap的规则