• Wide character in print at hcp.pl line 21.


    jrhmpt01:/root# cat -n hcp.pl 
         1	use LWP::UserAgent;  
         2	use Encode;
         3	 $ua = LWP::UserAgent->new;  
         4	 @header = (  
         5	    'accept'=> "application/json",  
         6	    'content-type'=> "application/json",  
         7	    'apix-key'=> "e7b00871640c49567a37566ccd5c27e9",  
         8	    'User-Agent' => "Mozilla/8.0"  
         9	    );  
        10	  
        11	$start = $ARGV[0];  
        12	$end = $ARGV[1];  
        13	$date = $ARGV[2];  
        14	$host="http://a.apix.cn/apixlife/ticket/rest?from=$start&to=$end&date=$date";  
        15	$request = HTTP::Request->new(GET=>"$host");  
        16	$request->header(@header);  
        17	  
        18	$response = $ua->request($request);   
        19	$content= $response->decoded_content;  
        20	$content =~ s/\u([0-9a-fA-F]{4})/pack("U",,hex($1))/eg;   
        21	print $content."
    ";;  
        22	print "-----------------------
    ";
        23	print encode_utf8($content);
        24	print "
    ";
    jrhmpt01:/root# perl hcp.pl BJP TJP 2015-12-11 
    Wide character in print at hcp.pl line 21.
    {"status": true, "validateMessagesShowId": "_validatorMessage", "messages": [], "httpstatus": 200, "validateMessages": {}, "data": {"message": "没有符合条件的数据!", "flag": false}}
    -----------------------
    {"status": true, "validateMessagesShowId": "_validatorMessage", "messages": [], "httpstatus": 200, "validateMessages": {}, "data": {"message": "没有符合条件的数据!", "flag": false}}

  • 相关阅读:
    PHP入门:在Windows中安装PHP工作环境
    Oracle数据库优化的经验总结
    引入js和css文件的总结
    PHP的加密解密字符串函数
    js+html5双人五子棋(源码下载)
    JAVA的网络编程基础概念
    asp.net的code-Behind技术
    10个调试Java的技巧
    Oracle基础 各种语句的定义格式
    CSS行高line-height的理解
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350441.html
Copyright © 2020-2023  润新知