Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我想使用 perltidy 就地更新文件,我该怎么做?假设我想运行 perl-tidyfoo.pl但我想进行更改foo.pl
foo.pl
您将使用选项-b和-bext='/'
-b
-bext='/'
perltidy -b -bext='/' foo.pl
取自手册页
确保您没有-st提供或-band-bext选项什么都不做;这实际上是我的问题。
-st
-bext
看起来perltidy有一个本机解决方案。并非所有程序都这样做。该sponge实用程序可用于实现对本机不支持它的程序的就地编辑。
perltidy
sponge
prog file | sponge file