title: How can I send Perl output to a both STDOUT and a variable?
body: <p>I would like to send the output from a command to both STDOUT and to a variable. I want to combine:</p>
  
  <pre><code>my $var = `some command` ;   
  system( 'some command' ) ;
  </code></pre>
  
  <p><a href="http://metacpan.org/pod/Tee" rel="nofollow noreferrer">Tee</a> is a step in the right direction but this sends it to a file rather than to a variable.  I guess I could then read the file but it would be simpler to get it straight there.</p>