Hi,
I have a script using 5.8.7 on Windows 2000 (5.00.2195) where commands in backticks work for a few hours, then they don't.
$backtest = `tlist`;
if (!$backtest) {
`shutdown /l /r /t:0 /c /y`
}
doesn't result in a shutdown, and other commands with visible side effects don't seem to execute either.
open (CMD, "tlist|") and reading from also works for a while, then doesn't.
system() calls work, so my workaround right now is system("tlist > dumpfile"), then reading from the dump file.
Has anyone seen behavior like this? Any divining questions or test to suggest?
http://perldoc.perl.org/perlfork.html mentions:
In certain cases, the OS-level handles created by the pipe(), socket(), and accept() operators are apparently not duplicated accurately in pseudo-processes. This only happens in some situations, but where it does happen, it may result in deadlocks between the read and write ends of pipe handles, or inability to send or receive data across socket handles.
Is there finer-grained documentation of what "certain cases" and "some situations" are?
Thanks.
EDIT: adding
if (!$backtest) {
open(CMD, "tlist|") or writelog ($debughashref,$msg_status,0,"bad fork $!");
Gets me: "bad fork Bad file descriptor"