title: Does Perl support named parameters in function calls?
body: <p>In my experience of languages that support the feature, programs that call functions with named parameters rather than positional parameters are easier to read and maintain.</p>
  
  <p>I think Perl has this feature, but it's not working for me.</p>
  
  <p>Is it a quirk of the package I'm using, or am I doing it wrong?</p>
  
  <h3>Setting up the function call</h3>
  
  <p>My fist Perl project is to use the HTML::TableExtract package to extract table data from HTML markup and display it as text.</p>
  
  <p>The following code sets up the parser:</p>
  
  <pre><code>use strict;
  use warnings;
  use HTML::TableExtract;
  
  my $markup = &lt;&lt;MARKUP;
  &lt;table&gt;
    &lt;tr&gt; &lt;th&gt;a&lt;/th&gt; &lt;th&gt;b&lt;/th&gt; &lt;th&gt;c&lt;/th&gt; &lt;/tr&gt;
    &lt;tr&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;/tr&gt;
    &lt;tr&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;6&lt;/td&gt; &lt;/tr&gt;
  &lt;/table&gt;
  MARKUP
  
  my $parser = HTML::TableExtract-&gt;new() ;
  
  $parser-&gt;parse($markup) ;
  </code></pre>
  
  <p>The <a href="http://search.cpan.org/~msisk/HTML-TableExtract-2.11/lib/HTML/TableExtract.pm" rel="noreferrer">documentation</a> says that I can dump output to the Command Prompt using the <code>tables_dump</code> method and use parameters <code>$show_content</code> and <code>$col_sep</code> to control the output format:</p>
  
  <blockquote>
    <p><code>tables_report([$show_content, $col_sep])</code></p>
    
    <p>Return a string summarizing extracted tables, along with their depth and count. Optionally takes a $show_content flag which will dump the extracted contents of each table as well with columns separated by $col_sep. Default $col_sep is ':'.</p>
    
    <p><code>tables_dump([$show_content, $col_sep])</code></p>
    
    <p>Same as tables_report() except dump the information to STDOUT.</p>
  </blockquote>
  
  <h3>Calling with positional and with named parameters</h3>
  
  <p>If I pass positional parameters in documentation order, I get the output I expect:</p>
  
  <pre><code>$parser-&gt;tables_dump(1, '_') ;
  </code></pre>
  
  <p>The columns are separated by an underscore instead of the default colon:</p>
  
  <pre><code>TABLE(0, 0):
  a_b_c
  1_2_3
  4_5_6
  </code></pre>
  
  <p>Following Perl.com's <a href="http://www.perl.com/pub/2006/02/23/advanced_subroutines.html" rel="noreferrer">Advance Subroutines article</a>, I tried to pass a hash containing parameter names and values to clarify the meaning of the parameters:</p>
  
  <pre><code>$parser-&gt;tables_dump({show_content =&gt; 1, col_sep =&gt; '_'}) ;
  </code></pre>
  
  <p>Perl doesn't understand this. It ignores the value of <code>col_sep</code> and outputs with the default value:</p>
  
  <pre><code>TABLE(0, 0):
  a:b:c
  1:2:3
  4:5:6
  </code></pre>
  
  <p>I get the same output if I don't try to change the separator:</p>
  
  <pre><code>$parser-&gt;tables_dump({show_content =&gt; 1}) ;
  </code></pre>
  
  <p>Even if I specify nonsense parameter names, I get the same output:</p>
  
  <pre><code>$parser-&gt;tables_dump({tweedledum =&gt; 1, tweedledee =&gt; '_'}) ;
  </code></pre>
  
  <p>Can I call this function using the named parameter style, or should I just settle for positional?</p>