in reply to Create a separate process with a sub...

Maybe this is (a) too obvious, or (b) not acceptable for some reason... but,

why don't you just fork? Given your criteria, that would be a simple and effective solution.

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.

Replies are listed 'Best First'.
Re: Re: Create a separate process with a sub...
by Foggy Bottoms (Monk) on Aug 15, 2003 at 12:24 UTC
    I thought fork() didn't work on Win32 systems ? I believe it's a Unix command only and not usable on WinNT, the OS I'm using...
      To my knowledge, fork() is emulated on Win32 systems using threads, thanks to the good work of Gurusamy Sarathy.

      Liz

      Contrary to poular myth, fork does work under win32 since at least 5.6. Under the covers it is implemented in exactly the same as threads are. IMO, the threads interface is easier to use than fork, but then I've never really made any great use of fork in C, so I'm coming from a different background.

      It also has the added bonus of making it reasonably easy to share data between parent and child.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
      If I understand your problem, I can solve it! Of course, the same can be said for you.