use strict; use warnings; my %hash1; $hash1{hello} = "world!"; foo(\%hash1); foo( { hello => 'world!!' } ); sub foo { my %hash2 = %{$_[0]}; print "hello " . $hash2{hello} . "\n"; } #output #hello world! #hello world!!