I want to configure a process pipeline from Perl (runs on Linux), consisting of two parts running at different times.
For example:
Run the consumer process:
open( OUT, "| tar xvf - " ) || die "Failed: tar: $!";
then start the renewal process much later:
open( IN, "gpg -d $file |" ) || die "Failed: gpg: $!";
but then somehow redirect the output from gpg to the input to tar.
I can do this by building a loop:
while (<IN> ) {
print OUT;
}
But I would like to know if I can somehow stick the two processes along with the redirect.
source
share