in reply to Re^10: Multi-threads newbie questions
in thread Multi-threads newbie questions
I'd be happy if you explained ("avoids the shell?")
The standard system command will either invoke the program you specify directly, or under some circumstances--eg. When the command line supplied contains shell meta-characters like 'prog > file' or 'prog | someOtherProg' --it will invoke a system shell (sh, csh, bash or cmd.exe) and supply the command line you supplied, to that shell.
In some quarters, invoking a shell to perform redirection, is seen as something extraordinarily dangerous for some reason. So they leap through hoops in order to avoid invoking a shell.
For your purposes, you need to invoke a shell in order that you can perform the cd path; prior to running the program, so you need to use capture() not capturex(). However, it also says in the docs that if you supply the arguments to the program as an array, then it will also "avoid the shell".
Quite frankly, I see no merit is using capture() over qx// for your purpose. Just a lot of extra code and dependency for little or no gain. But, others will disagree with that assessment.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: Multi-threads newbie questions
by Anonymous Monk on Sep 20, 2010 at 19:47 UTC | |
by BrowserUk (Patriarch) on Sep 20, 2010 at 20:02 UTC |