The code below works only with no strict. Can anyone suggest a better way to do it?
%hash5=('key5', 5);
my $hash_name = 'hash5';
print $$hash_name{'key5'}, "\n";
Again my aim: I do not know the hash name. I only know, it is store in the variable $hash_name. People have been suggesting things like:
my $hashref = \%hashABC;
which requires me to know that the hash name is '%hashABC'. Using this example just above i would like to do sth like:
my $hash_name = 'hashABC';
my $hashref = \%$hash_name; # not possible, hope u get the aim
now i do not need to know the name of the hash anymore. That is what i want.
Thx a lot guys! (perl 5)