use String::ShellQuote qw( shell_quote ); my $cmd = shell_quote('csh', '-c', 'wget http://... |& tee ...'); my $result = `$cmd`;