Hi Andy!
I found out now (using Dumper-mod) that my reference to the nested hash is undefined (but only when I use use strict;)
When I don't use strict the reference ($results) holds all the data I want and is dumped correctly. Here's the way I get the nested hash from a file (the only possibility I have):
my $filename = $ARGV[0]; open (_filehandle_, "<$filename") or die "Meeeeep! $filename does not +exist!\n"; my @file = <_filehandle_>; close (_filehandle_); my $line = join "", @file; my $results = eval ($line); print '$results: '.Dumper($results); my $colpattern = $results->{"col_pattern"};
That's pretty straight and ineffective code, but I better first try how things work and squeeze it up later then. ;-)
As output from ::Dumper I get: $results: $VAR1 = undef;
The fact that $results is undef tells me sth. goes wrong with eval().
Can it be that the use strict-statement affects or somehow impairs the evaluation of the file's contents (which is in $line now)?
Greetz, Micha
In reply to Re: Re: 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: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |