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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - 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,很难用。