Typically, two forms are usually used to run programs:
- takes a path and argument list
- accepts a shell command.
The first is safer and requires less resources.
system($prog, @args);
system({ $prog } $prog, @args);
, String:: ShellQuote ( unix) Win32:: ShellQuote ( Win32), .
use String::ShellQuote qw( shell_quote );
my $shell_cmd = shell_quote($prog, @args);
system($shell_cmd);