in reply to dereferencing syntax Re: Getting keys/values from a referenced hash
in thread Getting keys/values from a referenced hash
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: dereferencing syntax Re: Getting keys/values from a referenced hash
by andye (Curate) on Nov 28, 2001 at 16:02 UTC | |
by professa (Beadle) on Nov 28, 2001 at 17:55 UTC | |
by blakem (Monsignor) on Nov 28, 2001 at 18:26 UTC | |
by professa (Beadle) on Nov 28, 2001 at 19:07 UTC | |
by blakem (Monsignor) on Nov 29, 2001 at 02:31 UTC | |
| |
by professa (Beadle) on Nov 28, 2001 at 18:04 UTC | |
by professa (Beadle) on Nov 28, 2001 at 18:16 UTC |