其他提到perlrun。如果您使用的B :: Deparse,你可以看到它意思(对于大多数的东西):
$ perl -MO=Deparse -p -e 1
LINE: while (defined($_ = <ARGV>)) {
'???';
}
continue {
die "-p destination: $!\n" unless print $_;
}
-e syntax OK
1被表示为“???”,因为它被优化掉。
$ perl -MO=Deparse -p -i -e 1
BEGIN { $^I = ""; }
LINE: while (defined($_ = <ARGV>)) {
'???';
}
continue {
die "-p destination: $!\n" unless print $_;
}
-e syntax OK
-i设置$ ^我,像
$ perl -MO=Deparse -p -i.bak -e 1
BEGIN { $^I = ".bak"; }
LINE: while (defined($_ = <ARGV>)) {
'???';
}
continue {
die "-p destination: $!\n" unless print $_;
}
-e syntax OK
但要记住,<ARGV>使用2个参数的开放,所以没有与> <
启动或开始|
/结束的文件名。
google搜索基本答案有关Perl往往会导致你一些非常无益的网站。总是首先检查perl自己的文档。 – ysth 2011-06-10 05:09:06
借调。在这种情况下,'perldoc perlrun'列出了Perl接受的所有命令行选项。 – 2011-06-13 00:28:36
[perl.com上的一些Perl命令行选项的有用指南](http://www.perl.com/pub/2004/08/09/commandline.html)。 – 2011-06-10 09:50:30