in reply to Invoking perl script

As well as do, there are:

exec()

and

system()

use system('/path/to/temp2.pl'); if you want to block while temp2.pl executes, and then proceed with the rest of temp1.pl

use exec('/path/to/temp2.pl'); if you want temp2.pl to execute and then terminate temp1.pl directly afterward, essentially short-circuiting the rest of the code in temp1.pl

Replies are listed 'Best First'.
RE: RE: Invoking perl script
by AgentM (Curate) on Oct 18, 2000 at 08:08 UTC
    This may be more understandable as explaining system() as a secure use of a fork() and an exec() and exec() as a function that will load a program directly over your current program (actually replaces your current executable with a new one). Not a criticism, just a note. FYI.

    Please note that I never stated that system() is just a call to fork() and exec(), it is much more complicated than that. Implementing it yourself with fork() and exec() requires between 50-80 lines of C to be properly POSIX.2-compliant (involves proper shell env handling and signal handling).

    AgentM Systems nor Nasca Enterprises nor Bone::Easy is responsible for the comments made by AgentM.</h6>