in reply to open3 but for n file descriptors
Are you sure you really need to have the PID of child processes when using IPC::Run? It allows you to send signals and kill children directly. If you really must have the PID, it's possible to use start/pump/finish instead of run:
use strict; use warnings; use IPC::Run qw( start ); # Initiate the child process my $data; my $s = start [ 'ls' ], '>', \$data; # Show its PID for my $kid ( @{$s->{KIDS}} ) { print $kid->{PID}; } # pump data in and out, then clean up $s->pump; $s->finish;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: open3 but for n file descriptors
by tange (Initiate) on Jul 20, 2013 at 07:42 UTC | |
by tange (Initiate) on Jul 20, 2013 at 09:19 UTC |