小编shl*_*oro的帖子

使用Perl从xml文件中提取字符串

我需要使用Perl 提取关联rightmh =之后放置的字符串.

在此示例中:"0x42001dc"和"0x4200000".

每个字符串将添加到同一个数组中.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<association-response-list xmlns="http://url.com">
<association-responses>
<association rightmh="0x42001dc" leftmh="0x4055246" rh="0x1003b"/>
<association rightmh="0x4200000" leftmh="0x455246" rh="0x1003b"/>
</association-responses>
</association-response-list>
Run Code Online (Sandbox Code Playgroud)

xml perl xml-parsing

2
推荐指数
1
解决办法
297
查看次数

如何在 perl 中使用给定的“OR”?

我对 perl 中的 Given-When 语句很陌生。我想为 $var=0 或 2 获得相同的结果,有什么帮助吗?

我尝试了以下操作,但出现错误。

given($var) {
when(0 || 2) { print "bala";}
when(1) {print "blabla";}
default {print "default";}
}
Run Code Online (Sandbox Code Playgroud)

perl

2
推荐指数
1
解决办法
1049
查看次数

标签 统计

perl ×2

xml ×1

xml-parsing ×1