I'm forked off again

One of the most annoying barriers to Perl portability is fork(). Let's face it, fork() is UNIX through and through. Windows doesn't do fork, you have to use some awful Win32::Process::CreateProcess incantation, and pass it the name of the executable you want.

So after last night's excellent Toronto Perl Mongers meet, we talk a bit about Plack. Plack is cool, Plack would do just what I needed if I could install the darned thing. Unfortunately, because of fork(), I can't.

I don't use ActiveState's Perl, or Strawberry Perl. I made my own, using MinGW, and I turned off threading, as I want it to run a bit faster. It does run faster, but it doesn't have fork() emulation, so all those modules that assume fork for testing (and it usually is testing) typically fail. Not many fall victim to this (WWW::Mechanize and its friends are most of them). Unfortunately, Plack is another one.

Part of me feels that a Perl API could actually allow something more like CreateProcess, which is pretty easy to emulate using fork() and exec(). The reverse is not true. Maybe I should just contribute a module which could replace Test::TCP which didn't need to fork to do its tests, maybe just passing a script file to a newly created child process.

In the meantime, please, if you are writing a module, don't assume everyone will have fork().