perl 处理perl返回的json
2016-07-11 08:11
363 查看
[root@wx03 ~]# cat a14.pl use Net::SMTP; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Headers; use HTTP::Response; use Encode; use JSON; use File::Temp qw/tempfile/; use HTTP::Date qw(time2iso str2time time2iso time2isoz); use Data::Dumper; my $CurrTime = time2iso(time()); my $dis_mainpublish='中均资本'; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $now = time(); $ua->agent('Mozilla/5.0'); my $cookie_jar = HTTP::Cookies->new( file => 'lwp_cookies.txt', autosave => 1, ignore_discard => 1 ); $ua->cookie_jar($cookie_jar); my $response = $ua->get("http://120.55.118.6:3000/api/getcode?env=zj&phone=18072722237"); if ($response->is_success) { $r = $response->decoded_content; print "\n"; } else { die $response->status_line; }; #my $r=encode_utf8($r); my $hash = decode_json ( $r ); print $hash->[0]->[1]; print "\n"; [root@wx03 ~]# perl a14.pl Wide character in print at a14.pl line 38. 您的验证码为813231,本验证码30分钟内有效。
相关文章推荐
- perl 处理perl返回的json
- perl 处理perl返回的json
- perl中 wx返回的json需要encode_utf8($d);
- perl中 wx返回的json需要encode_utf8($d);
- perl中 wx返回的json需要encode_utf8($d);
- 20. 让 express 可以进行父子模板包含 express-ejs-layouts
- 点击按钮复制到剪贴板 js
- JavaScript 控制textarea(文本域)的输入字数
- Javascript 原型编程初探
- jsp中forward和redirect的区别(转)
- 两个示例介绍JavaScript的闭包
- .net实体类与json相互转换
- 回调函数中JSON对象的解析方式
- 浏览器跨域问题 jsonp
- JSON 中的毫秒时间( LONG) ,转换成年月日
- jstl根据字符串进行判断
- 如何将一个json中的json字符串转换成一个USER对象。
- XML转JSON
- 什么是JSON
- jsp的servlet,jsp原理