title: How do I toggle printing to STDOUT/STDERR dynamically in Perl?
body: <p>I'm curious if I can toggle between printing to STDOUT or STDERR based on some value or inline expression (without using an if statement).</p>
  
  <pre><code>print ($someFlag ? STDOUT : STDERR) "hello world!"
  </code></pre>
  
  <p>Obviously, that syntax doesn't work.</p>