Shlomi Fish wrote:
What system() does (at least on UNIX-like OSes) is fork a child, call exec()
with a new process and wait for the new child to terminate (plus some other
stuff to get rid of misbehaviours).

... and if you call "system" with just one long string, then Perl opens the system default shell between your script and the external application, you wanted to start.

So wherever possible you should prefer to use:

system('somecommand', '--param1=somevalue', '--anotherparam');

and not:

system('somecommand --param1=somevalue --anotherparam');

The first one opens *two* processes (the shell and "somecommand") while the second only opens one process and passes the arguments directly without any shell in between.

Yours

Manuel


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to