【发布时间】:2014-04-04 05:29:26
【问题描述】:
如果我这样做:
foreach my $comp (@compList){
print $comp .= "\n";
@component_dirs = DoStuff($comp);
}
我的输出很简单:
String1
String2
String3
...
但是,一旦我进入DoStuff() 方法,我就会这样做:
sub DoStuff{
my $strComponentName = @_;
print "\t$strComponentName\n";
}
这样,我的输出变成了
String1
1
String2
1
String3
1
...
为什么?
【问题讨论】:
标签: arrays perl parameters