in reply to best way to pass data
A better way would be to pass this data in a pipe:
Then have script.pl read in the data from its STDIN. If it can process this data as it comes in (instead of needing all the data before doing its thing), then the last two options above will be the most efficient, as they send one element of the array at a time to script.pl.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;
Whether this is the best way, I don't know. But it is a much better way than trying to have thousands of lines of code interpolated within backticks!
blokhead
|
|---|