Hello, Win32::OLE won't work with fork(). Lots of Win32 specific modules don't work with fork(). Signals are problematic too.
You'll need to go with a Win32 specific approach and code. But as you're using Win32::OLE that'll be no problem. I guess you're coming to Win32 Perl from a Unix background so life without fork will seem strange? Fortunately, many of the CPAN modules that do the sort of stuff fork() is just dandy for have working Win32 implementations under the skin - usually threaded so its not quite the same thing as forking a process. So, if you're writing a daemon or whatever, someone else will have already done the work for you (which is why we love CPAN). If you start putting fork() in your own original Win32 specific code, you'll age before your time. Best Regards Mark Malcolm Nooning wrote: > Hello, > > I would like to ask a few people who have a Windows2000 or WindowsXP > machine to run a short code snippet. > > There is no one forum on which to ask for this, so I am picking on this > par forum and asking for forgiveness for interrupting your normal flow > of thought. > > I am in communication with the author of Win32::Process::Info about an > Activestate Windows fork problem versus Win32::Process::Info. The > author has responded at http://rt.cpan.org/Public/Bug/Display.html?id=24286 > > It seems that the mere presence of a "use Win32::Process::Info" > statement, along with even an empty fork(), causes a perl interpreter > crash. As it turns out, there are a number of "use xxxx" things that > will result in a perl interpreter crash, if there is a Windows fork > involved. > > If you have a windows 2K or XP machine, please run the code snippet > below, after uncommenting each "use" statement, one at a time, in turn, > to see if your machine, too, exhibits the perl interpreter crash. On my > machine, any of the last four will cause it. I find it hard to believe > that such an important problem would never have been reported before. I > need to know if it is particular to my machine. > > Thanks > > ----------------------paste > #!/usr/bin/perl -w > > #use Win32::API; > #use Win32API::Registry; > #use Win32::OLE; > #use Win32::OLE::Const; > #use Win32::OLE::Variant; > #use Win32::Process::Info; > > if (my $pid = fork()) { > print "Parent\n"; > } > elsif(defined $pid) { > print "Child\n"; > exit; > } else { > print "Failed to fork:$!:\n"; > } > --------------------------end paste > >
