IPC::Open3 in order to work in as many platforms as possible has become so complex that its inners are almost inaccessible...
Anyway, you have several options:
- Use truss to see where (and why) the script is blocking at the OS level.
- Make your own version of open3. For Unix it should be quite simple (see below).
- ... or use some other CPAN module providing the same functionality (IPC::Run, IPC::Cmd, etc.).
# 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);
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.