1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/W/learn/ipc_open2
Nick Bebout e2bfc931f4 1.637
2015-05-28 12:04:57 -05:00

22 lines
391 B
Perl
Executable File

#!/usr/bin/perl -w
use strict ;
use IO::Handle ;
use IPC::Open2 ;
my( $chld_out, $chld_in ) = ( IO::Handle->new, IO::Handle->new ) ;
my $pid = open2( $chld_out, $chld_in, 'cat -n' ) ;
print $chld_in "LALALA\n" x 50000 ;
print $chld_in "LALALA\n" ;
print $chld_in "LALALA\n" ;
$chld_in->close ;
my @out = <$chld_out> ;
waitpid( $pid, 0 );
my $child_exit_status = $? >> 8;
print @out ;