我有这个程序,在命令提示符或“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