in reply to open3 hangs
Anyway, you have several options:
# untested use POSIX (); sub my_open3 { pipe my($in_c), my($in_p) and pipe my($out_p), my($out_c) and pipe my($err_p), my($err_c) or croak "unable to create pipes"; my $pid = fork; if (!$pid) { defined $pid or croak "fork failed"; unless (open STDIN, '<&', $in_c and open STDOUT, '>&, $out_c and open STDERR, '>&, $err_c) { warn "redirections failed"; POSIX::_exit(1); do { exec @_ }; POSIX::_exit(1); } close $in_c; close $out_c; close $err_c; return ($in_p, $out_p, $err_p, $pid); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: open3 hangs
by stephan_a (Novice) on Feb 20, 2009 at 10:10 UTC | |
by salva (Canon) on Feb 20, 2009 at 10:18 UTC | |
by stephan_a (Novice) on Feb 20, 2009 at 10:52 UTC |