title: How do I pass a hash to a function in Perl?
body: <p>I have a function that takes a variable and an associative array, but I can't seem to get them to pass right. I think this has something to do with function declarations, however I can't figure out how they work in Perl. Is there a good reference for this and how do I accomplish what I need?</p>
  
  <p>I should add that it needs to be passed by reference.</p>
  
  <pre><code>sub PrintAA
  {
      my $test = shift;
      my %aa   = shift;
      print $test . "\n";
      foreach (keys %aa)
      {
          print $_ . " : " . $aa{$_} . "\n";
          $aa{$_} = $aa{$_} . "+";
      }
  }
  </code></pre>