use String::ShellQuote qw( shell_quote ); my $cmd = shell_quote('csh', '-c', 'wget http://... |& tee ...'); my $result = `$cmd`; #### my $cmd = 'wget http://... |& tee ...'; open(my $pipe, '-|', '/bin/csh', '-c', $cmd) or die $!; my $result; { local $/; $result = <$pipe>; } #### my $cmd = 'wget http://... 2>&1 | tee ...'; my $result = `$cmd`;