Jorge Almeida wrote:
They're small enough to be slurped. The problem is that the chunk for a particular command may need to be passed to the shell for processing before being used by the Perl program. Something like this: 1 my @all=<STDIN>; 2 my @chunk=(); 3 for (@all){ 4 last if /^^D/; 5 push @chunk,$_; 6 }7 open(H,"|grep-something-or-whatever|");# yes, I know this doesn't work!8 for (@chunk){ print H $_;} 9 while(<H>){ 10 # do the real work now... 11 } The problem, of course, starts with line 7... I took a look at open(W,"|-") and open(R,"-|"). No good, the program is too complex to deal gracefully with forking...
See `perldoc perlfaq8` and search for "How can I open a pipe both to and from a command?" -- Just my 0.00000002 million dollars worth, Shawn "For the things we have to learn before we can do them, we learn by doing them." Aristotle -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
