I got a question concerning dereferencing hashes and use strict;.
I have a reference to a hash, derived from a reference to a nested hash:
my $hashref = $nested->{"key_to_hash"};
When I dereference that $hashref via
line 35: my %realhash = %{$hashref};
and when I "use strict" I get the following message:
Can't use an undefined value as a HASH reference at /home/user/programming/perl/perlscript.pl line 35 (#1) (F) A value used as either a hard reference or a symbolic referenc +e must be a defined value. This helps to delurk some insidious errors.
Line 35 is the line where I dereference from $hashref.
When I don't use strict everything works fine...I got no idea what means "defined value" here. All my refs and vars are defined, or am I wrong?
Have a nice day and thanks for the tips yesterday!
Micha
In reply to Re: dereferencing syntax Re: Getting keys/values from a referenced hash
by professa
in thread Getting keys/values from a referenced hash
by professa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |