gpt4 book ai didi

perl - 在 Perl 中 Grep 一个 YAML 文件

转载 作者:行者123 更新时间:2023-12-02 04:27:16 25 4
gpt4 key购买 nike

Perl 中是否有任何模块可以在 yaml 文件中 grep 任意层次结构 - 就像 python 中的 ygrep 一样?或者有什么代码可以做到这一点?我尝试谷歌搜索,但没有找到任何资源/指针。几个小时以来我一直在尝试但运气不佳。

最佳答案

LoadFile返回哈希引用。

my $href = YAML::LoadFile("file.yaml");

检查 CPAN 是否有 deep data structure traversing module ,例如

关于perl - 在 Perl 中 Grep 一个 YAML 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17329542/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com