惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

PCI Perspectives
PCI Perspectives
SecWiki News
SecWiki News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
K
Kaspersky official blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
A
About on SuperTechFans
T
Tenable Blog
B
Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Scott Helme
Scott Helme
Cloudbric
Cloudbric
IT之家
IT之家
P
Privacy & Cybersecurity Law Blog
博客园 - Franky
V2EX - 技术
V2EX - 技术
The Register - Security
The Register - Security
Latest news
Latest news
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
O
OpenAI News
Stack Overflow Blog
Stack Overflow Blog
量子位
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
T
Tailwind CSS Blog
GbyAI
GbyAI
Project Zero
Project Zero
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 司徒正美
Schneier on Security
Schneier on Security
美团技术团队
A
Arctic Wolf
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google Online Security Blog
Google Online Security Blog
F
Full Disclosure
博客园 - 【当耐特】
Y
Y Combinator Blog
Help Net Security
Help Net Security
S
Secure Thoughts
Jina AI
Jina AI

博客园 - zhumao-2

cnblogs终于把以前内容的管理权还给我了~ 曙光服务器千兆光纤网卡安装 关于DBI->connect ($dsn, $db_user, $db_pass, { RaiseError =>1, PrintError => 0}) - zhumao-2 RichCopy 3.5 过期?自己想办法~ 将linux密码存储到OpenLDAP里面=OpenLDAP Everywhere Revisited C语言操作OpenLDAP Perl操作OpenLDAP(未测试) 心得共享:Oracle经验技巧集锦 [From CU] 使用Perl生成usmarc记录 牛郎织女 Perl中的trim函数 在 Perl 中使用内联 perl中的特殊内置变量(转) 从网页中提取链接(转载) 在指定文件夹中的文件中查找包含指定字符的行(这个小东西不错[Perl]) 打开.bz2文件 Windows 能干而 Linux 干不了的事情,那就是不需要干的事情 Linux下用Perl产生新的EXCEL文档 RPM包强制删除
perl将json转换成xml
zhumao-2 · 2018-10-02 · via 博客园 - zhumao-2

#!/usr/bin/perl

use strict;
use JSON::Any;
use XML::Simple;

my $json = '{"name":"zhumao","pass":"123","other":[{"a0":"a0a0a0","b0":"b0b0b0"},{"a1":"a1a1a1","b1":"b1b1b1"}]}';

$json=~s/[\x00-\x1f]//g;#过滤不可见字符
my $convertor = JSON::Any->new();
my $data = $convertor->decode($json);
my $xml = XMLout($data);#生成xml

open(O,">:utf8","test.xml");#将xml写入文件(如果有中文,需要加:utf8)
print O qq#<?xml version="1.0" encoding="UTF-8"?>\n#;
print O $xml;
close(O);

注:不要使用JSON2XML,很难用。