my $cmd = 'wget http://... 2>&1 | tee ...'; my $result = `$cmd`;