perl 处理json 数组格式

来源:互联网 发布:孕妇尿常规检查数据 编辑:程序博客网 时间:2024/05/22 09:48
[root@dr-mysql01 ~]# cat a1.pl use Encode;  use JSON;   use URI::Escape;  use LWP::Simple;  my $host = "http://192.168.32.101:3000/api/getcode?env=zj&phone=18072722237";  my $content = get($host);  print "\$content  is $content\n";      print "111111111111111111111\n";print $content->[0]->[1];print "\n";print "3333333333333333333333333\n";my $array = decode_json($content);print $array->[0]->[1];print "\n";[root@dr-mysql01 ~]# perl a1.pl $content  is [["2016-04-27 13:04:30,325","您的验证码为956047,本验证码5分钟内有效。 ","to phoneNo:18072722237"],["2016-04-27 13:05:58,839","您的验证码为161980,本验证码5分钟内有效。 ","to phoneNo:18072722237"]]1111111111111111111113333333333333333333333333Wide character in print at a1.pl line 20.您的验证码为956047,本验证码5分钟内有效。



0 0
原创粉丝点击