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).
$Bill Luebkert wrote:
Foo Ji-Haw wrote:
Hello Karthik,
I am not a monk, but I have a simple answer to your question.
IIRC, the main diff between exec() and system() is that one waits for the call to complete before continuing, whereas the other does not. You have to read the docs to figure out which is which.
exec replaces the current process with a new version of the same process and basically starts over again from scratch.
system runs a child process and waits on it.
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
