my %hash = ( one => 1, two => 2, ); foo(%hash); sub foo { print join(' | ', @_), "\n"; } #### sub foo { my %hash = @_; } # works fine foo(%hash); # uh oh foo('nameofhash', %hash); # not good at all foo(@names, %hash); #### # pass a reference to %hash, which is a scalar foo(\%hash); sub foo { my $hashref = shift; } #### sub foo { my $hashref = shift; # add data bar($hashref); } sub bar { my $hashref = shift; # manipulate data as above }