title: How can I get a Perl script to accept parameters from both STDIN and command line arguments?
body: <p>Inspired by this U&amp;L Q&amp;A titled: "<a href="https://unix.stackexchange.com/questions/171150/back-to-back-pipes-into-a-command">https://unix.stackexchange.com/questions/171150/back-to-back-pipes-into-a-command</a>". How could one parse both input via STDIN and via command line arguments to a Perl script?</p>
  
  <p>For example I'd like a script that can consume input parameters from both STDIN and via command line arguments:</p>
  
  <pre><code>$ command | my_command.pl arg1 arg2
  </code></pre>
  
  <p>And the output of <code>command</code> would be </p>
  
  <pre><code>arg3
  arg4
  ...
  </code></pre>
  
  <p>So while <code>my_command.pl</code> is running, it would be aware of the parameters arg1, arg2, arg3, and arg4.</p>