in reply to Re: Re: Complex Data Structures 2
in thread Complex Data Structures 2

Well, for being new to Perl this is a quite complicated data structure ;-). But using symbolic references is a bad idea! Why? Imagine you have already a hash called %hello in your program, this gets overwritten. And you normally don't have any influence on the values you get, so you could overwrite any hash already defined in your program. And there are more issues to that.

The solution is simply to put everything into a new hash with the key being "hello" in your example and the value is the return value from extrct(). So you would write sth like this:

$new_hash{$file{data}} = { extrct() }; # or if extrct returns a hash reference $new_hash{$file{data}} = extrct();

-- Hofmator