Re: Hashes of Hashes
- From: Uri Guttman <uri@xxxxxxxxxxxxxxx>
- Date: Fri, 29 Dec 2006 12:19:13 -0500
"JS" == Jen Spinney <jen.spinney@xxxxxxxxx> writes:
JS> If you want to make hashes of hashes or any other complex data
JS> structure like that, you probably want to be using references. Perl
JS> flattens arrays/hashes contained in another array/hash. That is, (1,
JS> 2, 3, 4, (1, 2, 3)) is the same as (1, 2, 3, 4, 1, 2, 3). Take a look
JS> at perldoc perldsc and/or perldoc perlreftut. You might also want to
JS> use the Data::Dumper module to take see what your data structures
JS> actually look like (so you know you've done it correctly). If you add
the OP IS using references but doesn't know it. and there is no
flattening going on anywhere. the problem is that he assigns a regular
scalar value to some node in his data tree and also assigns a hash ref
(the .003 stuff) to the same node overwriting it (depending on the order
he does them). a given node can have a single value which can be a
scalar value OR a reference to another level but not both.
uri
--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
.
- References:
- Hashes of Hashes
- From: Jason Malburg
- Re: Hashes of Hashes
- From: Jen Spinney
- Hashes of Hashes
- Prev by Date: Re: Hashes of Hashes
- Next by Date: Re: Accessing the values of HoH
- Previous by thread: Re: Hashes of Hashes
- Next by thread: Re: Hashes of Hashes
- Index(es):
Relevant Pages
|