On Sun, 5 Aug 2007, Mr. Shawn H. Corey wrote:
How big are these files? Could you read everything at once? If it's
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...
--
Jorge Almeida
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/