Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

RE: Invoking perl script

by Zarathustra (Beadle)
on Oct 18, 2000 at 07:51 UTC ( [id://37279]=note: print w/replies, xml ) Need Help??


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>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://37279]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-26 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found