in reply to fork on Windows (Perl 5.8)

Yes, that's definitely a bug in Perl. Your post is not clear, but when I try it out, everything that's printed to STDOUT in the child thread goes into the file "fork_test.txt". You should submit a bug report. There's a "perlbug.bat" to help you do that.

There are probably workarounds to this, but it's not completely clear what you're trying to do. I realize this is just a bug demonstration program, but it has a terrible race condition. If you just want the output of ipconfig, why don't you just say $l = `ipconfig`?

Replies are listed 'Best First'.
Re: Re: fork on Windows (Perl 5.8)
by dave_usa (Novice) on Jun 30, 2003 at 19:01 UTC
    I do not know what you mean by "race condition". As you said, it is just a bug demo. In real, the same events as these in this short script occur in different objects. The code is very complicated and I don't want go into describing it.
      Race Condition. In this particular case, one process is opening a file that may or may not be created yet. If it does succeed in opening it, it may read the contents of the previous run of the program. If it doesn't succeed, it loops forever.