http://www.perlmonks.org?node_id=1071327


in reply to 'system @list' in background?

system('cmd foo bar &')
is short for
system('/bin/sh', '-c', 'cmd foo bar &')

But you're surely asking to pass cmd, foo and bar as separate args.

We can use sh to build the command:

system('/bin/sh', '-c', '"$@" &', 'dummy', $prog, @args);

Or we can use a Perl module to build the command:

use String::ShellQuote qw( shell_quote ); system(shell_quote($prog, @args) . ' &'));