title: Named parameters in Perl
body: <p>I'm attempting to use named parameters in Perl. I've been using <a href="http://web.archive.org/web/20160920193219/http://perldesignpatterns.com/?NamedArguments" rel="nofollow noreferrer">http://perldesignpatterns.com/?NamedArguments</a> as a reference.</p>
  
  <p>It seems to make sense. However, I can't seem to actually get the values sent in.</p>
  
  <p>I have tried changing to <code>$args{'name'}</code>, <code>$args{"name"}</code> as well and no luck. I just can't seem to get the values passed in. Which direction do I need to look in to figure out what on earth is happening?</p>
  
  <h3>File doh.pm</h3>
  
  <pre><code>package doh;
  sub new ()
  {
     my %args = @_;
     $name = $args{name};
     print $name;
  }
  1;
  __END__
  </code></pre>
  
  <h3>File test.pl</h3>
  
  <pre><code>use warnings;
  use doh;
  $trial = doh::;
  $trial-&gt;new(name =&gt; "Tyson");
  </code></pre>
  
  <p>No output is printed when test.pl is run.</p>