in reply to system call windows
It's safer to use the list version of system:
system('/sbin/start', '/skipinfo', qq{-proxy:"$proxy_domain"});
I usually prefer to be explicit as to which executable gets called (fully qualify the path rather than a relative path). And it's a good practice to check the exit code of the system call. You'll want to read the documentation for system and perlvar (paying attention to the description of $?).
How safe all this is really depends a lot on what type of environment you're running it in. The primary advantage to using the list version of system is that it avoids the shell, thus reducing the potential for interpolation or unwanted redirection, piping, or code injection.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: system call windows
by BrowserUk (Patriarch) on Mar 06, 2019 at 22:07 UTC | |
by salva (Canon) on Mar 08, 2019 at 12:23 UTC | |
by BrowserUk (Patriarch) on Mar 08, 2019 at 14:18 UTC | |
by haukex (Archbishop) on Mar 10, 2019 at 19:51 UTC | |
by BrowserUk (Patriarch) on Mar 10, 2019 at 21:40 UTC | |
|