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";