in reply to Re: Re: Passing Array to seperate file
in thread Passing Array to seperate file

That's why I suggested reading perlopentut. Here's an example.....

# controlcript open WORKER, "| workerscript.pl" or die; print WORKER "$_\n" for @combined; close WORKER; # This is the worker script, entitled workerscript.pl my @combined; while ( <STDIN> ) { push @combined, $_; } chomp @combined;

Or just slurp in the worker script...

my @combined = <STDIN>; chomp @combined;

Dave

Replies are listed 'Best First'.
Re: Re: Re: Re: Passing Array to seperate file
by scottness (Initiate) on Mar 01, 2004 at 16:49 UTC
    This code looks like it would work, but I want to have the initial script to finish completely before I call the second and I believe the code you have will pipe the information as it happens. Some background. What I have is my initial file pulling files from my server and adding to my array if it meets a certain criteria. I added the system(targetscript.pl, @arraytobepassed); after all files have been checked. I want to use that @arraytobepassed in my second file which parses the "filtered array" and does it's own processing. But I can't get it to work since I have my code set to read each line from a file instead of an array. Any help?