in reply to Hash references?
my %$foo=("key1"=>"value1","key2"=>"value2");I think you really want:
The difference is that $foo refers to the scalar variable whereas $foo{'key1'} accesses the hash %foo (with key key1).my %foo=("key1"=>...);
If you want to create a reference to a hash, use curly braces:
and then you access values in the hash with the -> operator, e.g. $hash_ref->{key1}.my $hash_ref = { key1 => ... };
|
|---|