for (my $i = 3; $i >= 0; $i--) { close($handles[$i]); }
In Perl, I'd prefer something like this instead of the C style for loop (YMMV of course):
close $handles[$_] for reverse 0..3;
(the explicit reverse emphasizes that it's essential here to do something in reverse order of how you'd do it normally)
In reply to Re^2: Forked pipe deadlock
by almut
in thread Forked pipe deadlock
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |