2
當我以這種方式將參數傳遞給system
時,從String::ShellQuote使用shell_qoute
有意義嗎?String :: ShellQuote:我什麼時候需要`shell_quote`?
#!/usr/bin/env perl
use warnings;
use 5.012;
use String::ShellQuote qw(shell_quote);
my $file = shift;
my $argument = shift;
$file = shell_quote $file;
$argument = shell_quote $argument;
system('some_command', '--verbose', '-o', $file, $argument);