我有一个Perl函数如下:
sub create_hash()
{
my @files = @_;
foreach(@files){
if(/.text/)
{
open($files_list{$_},">>$_") || die("This file will not open!");
}
}
}
我正在通过如下方式将数组参数传递给此函数:
create_hash( @files2);
这个数组里有大约38个值。
但是我却收到编译错误:
Too many arguments for main::create_hash at ....
我在这里做错了什么?
我的 Perl 版本是:
This is perl, v5.8.4 built for i86pc-solaris-64int
(with 36 registered patches, see perl -V for more detail)
()
去掉?(比如sub create_hash { .. }
) - user166390