or download this
#save a reference to a single array containing the lines from both sub
+-processes:
$results[$j][$z] = [ @result_1, @result_2 ];
...
$results[$j][$z] = [ \@result_1, \@result_2 ];
print $results[$j][$z][0][0]; #print the first line from test1.ksh
print $results[$j][$z][1][0]; #print the first line from test2.ksh