I think that's what he's trying to do, but he's also modifying the global
@array1, and he wants to modify the global
@array2 the second time around.
Personally, I'd consider that poor style, and rewrite it as...
@array1 = file_processing($script,$arg1,$file1);
@array2 = file_proceesing($script,$arg2,$file2);
...
sub file_processing {
my ($script,$arg,$file) = @_;
my @results;
...
return @results;
}
Actually, I wouldn't... I'd call the sub "processfile", and make several other tweaks if I was writing this myself, but that's just me.