my $arg1 = "foo"; my $file1 = "file_1.gz; my $arg2 = "bar"; my $file2 = "file_2.gz"; sub file_processing { $script = "/export/home/ssesar/Perl/another_script.pl"; $open = "$script -e $arg1 $file1"; open(FILE1, "$open |") or die "can't do it\n"; while () { chomp; next if /^\#/; next if /None/; next if /Unkno/; next if /unkno/; next if /NONE/; @_ = split ( /\n/, $_); @array1 = @_; } close FILE1; } #### 2. Then, I want this subroutine to be run a second time with the following changes: $open = "$script -e $arg2 $file2"; open(FILE2, "$open |") or die "can't do it\n"; while () { #### @array2 = @_;