加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl 定义post接口

发布时间:2020-12-15 23:39:30 所属栏目:大数据 来源:网络整理
导读:use Mojolicious::Lite;use JSON qw/encode_json decode_json/; use Encode;no strict;use JSON; use Data::Dumper;#no utf8;# /foo?user=sri post '/admin/api/menu' = sub { my $c = shift; print "测试更健康n"; my @arr1=(); open (LOG1,"",'/data01/ap
use Mojolicious::Lite;
use JSON qw/encode_json decode_json/;  
use Encode;
no strict;
use JSON; 
use Data::Dumper;
#no  utf8;
# /foo?user=sri
 post '/admin/api/menu' => sub {
          my $c = shift;
          print "测试更健康n";
          my @arr1=();
         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 $strn";
					next if ($str !~ /$d/);
					print "2--------$str is $strn";
					push (@arr1,decode_utf8($str));
					}};
					
					close LOG1;
          $c->render(json =>  @arr1 );
};
				   


  app->start;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读