open my $fh, "|/tmp/scripts.pl" or die "Can't pipe scripts.pl: $!"; ## send the data to script.pl: print $fh @ARRAY; ## or: print $fh join "\n", @ARRAY; ## or probably best: print $fh $_ for @ARRAY; ## or, depending on what's exactly in @ARRAY: print $fh "$_\n" for @ARRAY;