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

标签 perl shell

如何将 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/

相关文章:

python - Python 中的负 RegEx 模式匹配等同于 Perl(!~ operator)

perl - 如何控制 Perl Data::Dumper 中的变量名?

python结构解压

linux - '查找'目录下的所有 .log 文件,将它们复制到另一个以其父目录命名的目录?

javascript - Gnome javascript 文档

linux - 在 shell 脚本中将字符串转换为十进制并计算

perl - 避免使用 Parse::FixedLength 修剪所有前导/填充字符

perl - 如何在 Perl 6 中检查文件时间戳属性?

shell - 如何自动将zipfile从本地文件系统复制到HDFS

bash - 将 gdb 变量传递给从 gdb 执行的 shell 命令