in reply to passing a variable value to Unix command
I had a hard time generating that error.
$ find . -name "doesn't exist" -print $ find . -name "" -print $ find . -name -print $ find . -name find: missing argument to `-name'
There's no way the command you're executing could generate that error with my find. Maybe if $k contained a newline and you hadn't used quotes.
Anyway, if you want to avoid unintentional interpolation, use IPC::System::Simple's capturex.
my $output = capturex(find => ( -name => "$k*", -print ));
By the way, "\*" is the same as "*".
|
---|