我有這個程序,在命令提示符或「perl program.pl file1.txt file2.txt」中使用「perl program.pl」在Windows上運行OK。Padre給出關於不存在的行的錯誤消息
use strict;
use warnings;
print "there were ",scalar(@ARGV), " arguments passed to this program\n";
if (scalar(@ARGV) > 1)
{
print "First Argument: $ARGV[0]\n";
print "Second Argument: $ARGV[1]\n";
}
sub process_file($)
{
my $filename = shift;
print "will process file $filename\n";
#open(INPUT_FILE,"<$filename") || die("could not open $filename");
}
即使退出和回來到神父後,我得到這個對話框,當我去運行它(如果我點擊Yes按鈕,將仍然運行正常):
警告X線31:使用| char在沒有|的情況下打開在開頭 或結束通常是一個錯字。你想繼續嗎?
[YES] [NO]
你不應該使用原型(你的子名稱後面的'($)'部分),除非你知道它們是什麼(我猜你沒有)。只需使用'sub process_file {...}'。 – TLP