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!!
In reply to Re: Passing hashes to subroutines
by blueAdept
in thread Passing hashes to subroutines
by rbi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |