use threads; use threads::shared; my @file1 : shared; my $t1 = async{ my $getfile1 = qq/getS1config.pl/; open (FILE1, "$getfile1 |" ); @file1 = ; }; my @file2 : shared; my $t2 = async{ my $getfile2 = qq/getS2config.pl/; open (FILE2, "$getfile2|" ); @file2 = ; }; my @file3 : shared; my $t3 = async{ my $getfile3 = qq/getS3config.pl/; open (FILE3, "$getfile3 |" ); @file3 = ; }; $_->join for $t1, $t2, $t3; ## Do stuff with the arrays.