Scripting >> Perl >> How to pass a hash to a subroutine


## Hashes can be passed either by value:

 
 mysub(%hash);
 
 sub mysub {
   my (%params) = @_;
 }
 

## or by reference:  

 
 mysub(\%hash);
 
 sub mysub {
   my $params = shift;
   my %paramhash = %$params;
 }