If I do:
foreach my $comp (@compList){
print $comp .= "\n";
@component_dirs = DoStuff($comp);
}
My output is simply:
String1
String2
String3
...
However, once I get into the method DoStuff()
, I do:
sub DoStuff{
my $strComponentName = @_;
print "\t$strComponentName\n";
}
With this, my output becomes
String1
1
String2
1
String3
1
...
Why?