in reply to How to call perl script within perl script ?

Besides all the excellent advice already given there is one important aspect: processes!

For example on unix-like the question would be

  • Do you want to start another process and wait till it finishes?: system or even system with time-out (if you shell supports it). Still you'll need to record the status carefully to know if the execution went OK or no.
  • Do you want to run some more code in the same process?: do, require or eval "string".
  • Do you need to fire one or more processes and then communicate with them to hand out tasks or queries (worker or co-process view)?: then you have the whole spectrum of IPC.

    All of those have their use. The firing of an external process is often neglected these days but lets the OS do the safety net (restarting yourself can be a useful trick even). Choose wisely ;)

    cheers --stephan
    • Comment on Re: How to call perl script within perl script ?