title: How to pass optional parameters to a Perl function?
body: <p>I want to pass several parameters, one of which is optional, to a function. The only way to do it that I know is using a list (@) as a parameter. Thus, it contents nothing or 1 element (will never be undef), so that I can use the following code:</p>
  
  <pre><code>sub someFunction($$@) {
      my ( $oblig_param1, $oblig_param2, $option_param ) = @_;
      ...
  } 
  </code></pre>
  
  <p>This code works, but I feel that maybe it's not the best workaround.<br>
  Are there any other ways to do it?<br>
  Thank you.</p>