in reply to Re: Hash of hashes syntax
in thread Hash of hashes syntax
I'm afraid your last solution, as concise as it might be, simply does not work. \%h always refers to the same hash. You may well change its content at each loop, you're always modifying the same hash, and all members of %hash_of_hashes refer to it.
You really must create a new hash at each loop. This will do it:
(the hash keys and values are flattened into a list, which in turn is used to create an anonymous hash).$hash_of_hashes{$rn} = { %h };
--bwana147
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Hash of hashes syntax
by Enlil (Parson) on Mar 19, 2003 at 09:19 UTC | |
Re: Re: Re: Hash of hashes syntax
by Chmrr (Vicar) on Mar 19, 2003 at 09:24 UTC |