in reply to best way to pass data
Passing the whole array as an argument on the command line will probably fail. There's simply a limit to how long the argument list can be, and I doubt it can have newlines.
Here's a quick solution (many others are possible):
Make the recieving script read from STDIN (ie. while(<>) { chomp; print; }).
Then instead of backtics, use open.
# Note the | here. This allows you to write to your script open(SCRIPTS, "| /tmp/scripts.pl") or die; foreach my $line (@ARRAY) { print SCRIPTS $line . "\n"; } close SCRIPTS;
Hope this helps,
~J
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: best way to pass data
by Anonymous Monk on Aug 23, 2003 at 04:27 UTC | |
by Anonymous Monk on Aug 23, 2003 at 08:40 UTC | |
by rishard (Initiate) on Aug 23, 2003 at 18:13 UTC | |
by jmanning2k (Pilgrim) on Aug 26, 2003 at 16:59 UTC |