use strict; use warnings; my $cmd = qq{ /usr/bin/wget "http://www.google.com" }; $cmd .= q{ |& tee /path/to/tee.log }; my $result = `$cmd`; print "$result\n"; #### sh: -c: line 0: syntax error near unexpected token `&' sh: -c: line 0: `/usr/bin/wget "http://www.google.com" |& tee /path/to/tee.log '