A
Andreas Boehm
Hello,
does there exist an interference between close() and waitpid() in the
folling code fragement, that uses an open() to a piped command?
$fhcmd=new FileHandle;
$pidcmd=open($fhcmd,"$cmd |");
if (defined($pidcmd)) {
$selcmd=new IO::Select($fhcmd);
while (!eof($fhcmd)) {
my (@cmdfhready);
@cmdfhready=$selcmd->can_read(1);
if (scalar(@cmdfhready)>0) {
$a=<$fhcmd>;
print STDOUT $a;
}
}
close $fhcmd;
waitpid $pidcmd, 0;
} else {
$fhcmd=undef;
$pidcmd=undef;
$OK=1;
}
Does there exist a need of a waitpid() after the close()?
regards,
Andreas
does there exist an interference between close() and waitpid() in the
folling code fragement, that uses an open() to a piped command?
$fhcmd=new FileHandle;
$pidcmd=open($fhcmd,"$cmd |");
if (defined($pidcmd)) {
$selcmd=new IO::Select($fhcmd);
while (!eof($fhcmd)) {
my (@cmdfhready);
@cmdfhready=$selcmd->can_read(1);
if (scalar(@cmdfhready)>0) {
$a=<$fhcmd>;
print STDOUT $a;
}
}
close $fhcmd;
waitpid $pidcmd, 0;
} else {
$fhcmd=undef;
$pidcmd=undef;
$OK=1;
}
Does there exist a need of a waitpid() after the close()?
regards,
Andreas