in reply to best way to pass data

Many systems will not allow you to pass so much data on the commandline. And as you have it written, it's very insecure -- all the contents of @ARRAY are interpolated and sent to the shell to be executed. What if @ARRAY contained something like " ;; rm -rf / ;; " ? With the simplistic backticks, the special characters (and you say you're dealing with "lines of code" in @ARRAY -- you'll get in trouble at least by the first semicolon) will cause too many problems.

A better way would be to pass this data in a pipe:

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;
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.

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