in reply to Re: dereferencing syntax Re: Getting keys/values from a referenced hash
in thread Getting keys/values from a referenced hash
Well, this line (which I think is equivalent) works ok:
The error message simply means that $hashref is undefined, i.e. the scalar called 'hashref' contains no value. So this means that there is a problem with $nested->{key_to_hash} - maybe the key key_to_hash doesn't exist, or the value is undefined. Maybe $nested is pointing to the wrong hash.perl -e 'my $nested = { key_to_hash => {data => "here"}}; print %{$nes +ted->{key_to_has h}};'
An easy way to see what's gone wrong is to use the module Data::Dumper - which is standard, so you probably have it. Do this:
and you'll see the contents of the hash referred to by $nested.use Data::Dumper; print Dumper($nested);
If you can't see what's up with it, post the code where you set up $nested.
Have a nice day and thanks for the tips yesterday!
That's ok, you too.
andy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: dereferencing stuff
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 29, 2001 at 17:43 UTC | |
|
Re: Re: Re: dereferencing syntax Re: Getting keys/values from a referenced hash
by professa (Beadle) on Nov 28, 2001 at 18:04 UTC | |
by professa (Beadle) on Nov 28, 2001 at 18:16 UTC |