其他提到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