Foo Ji-Haw wrote:

> I don't think exec() 'starts over again from scratch'. Here's a quote 
> from perlfunc:
> 
> The |exec| <cid:[EMAIL PROTECTED]> function executes a 
> system command /and never returns/-- use |system| 
> <cid:[EMAIL PROTECTED]> instead of |exec| 
> <cid:[EMAIL PROTECTED]> if you want it to return. It 
> fails and returns false only if the command does not exist /and/ it is 
> executed directly instead of via your system's command shell (see below).
>
> I will say that exec() stops the current program and start on a new one 
> as per exec() parameters. But all these will happen in the same process 
> (ID).

The important thing to note is that the script you are running goes
away entirely - stops executing (whether or not it uses the same pid
or process space would most likely be OS dependent).  The process
(script) running is *replaced* by the newly exec'd image; whilst with
the 'system' command the script continues to run with a child process
being forked which it waits on.

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to