gpt4 book ai didi

perl - 如何将 shell 脚本转换为 Perl 脚本?

转载 作者:行者123 更新时间:2023-12-03 22:22:58 25 4
gpt4 key购买 nike

如何将 shell 脚本转换为 Perl 脚本?

我有一个 10k 行的 shell 脚本,想把它转换成 Perl。有没有什么工具可以做到这一点,或者有什么办法可以做到这一点?

最佳答案

没有简单的转换器。来自 Perl 常见问题“How-can-I-convert-my-shell-script-to-perl?

Learn Perl and rewrite it. Seriously, there's no simple converter. Things that are awkward to do in the shell are easy to do in Perl, and this very awkwardness is what would make a shell->perl converter nigh-on impossible to write. By rewriting it, you'll think about what you're really trying to do, and hopefully will escape the shell's pipeline datastream paradigm, which while convenient for some matters, causes many inefficiencies.

关于perl - 如何将 shell 脚本转换为 Perl 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2801811/

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