要转义要用作shell参数的字符串,我们使用函数escapeshellarg()in PHP.是否Perl具有同等功能?
dax*_*xim 31
String::ShellQuote,但大部分时间都不需要这样做.您可以通过仔细编程来避免调用shell.例如,system获取参数列表而不是字符串.
最佳实践:
use IPC::System::Simple qw(systemx);
systemx($command, @arguments);
Run Code Online (Sandbox Code Playgroud)
require IPC::System::Simple;
use autodie qw(:all);
system([@allowed_exit_values], $command, @arguments);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7819 次 |
| 最近记录: |