in reply to Trying to pass a hash of hash of lists
There is no clean way to get that info via the registry so I decided to hard code the info in a hash of hash of lists.
I don't like spreading bad news, but a hash of lists is not really possible. A list of lists is neither.
Lists and arrays are different things. An array is mutable, but lists are not (lists are immutable ("read-only")). Consider:
This is the point where most people think "But what about perllol? That talks about lists of lists!". Well, perllol is wrong, sorry.# A list (1, 2, 3); # An array assignment (syntax: ARRAY = LIST) my @array = (1, 2, 3); # An array @array # The third element of the array $array[2] # The third element of a list (this actually is a slice) (1, 2, 3)[2] # Arrays are mutable, so the following is possible $array[2]++ # Lists are immutable, so the following is impossible (1, 2, 3)[2]++ # A reference to a named array \@array # A reference to an anonymous array [ 1, 2, 3 ] # A reference to a named array that later becomes anonymous my $ref; { my @array = (1, 2, 3); $ref = \@array; } # A list of references \(1, 2, 3) # Equal to \(1, 2, 3) (\1, \2, \3) # A list of arrays ([1, 2, 3], [4, 5, 6], [7, 8, 9]) # A reference to an (anonymous) array of (anonymous) arrays [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Trying to pass a hash of hash of lists
by tye (Sage) on Mar 14, 2002 at 17:39 UTC | |
by Juerd (Abbot) on Mar 14, 2002 at 17:52 UTC | |
by tye (Sage) on Mar 14, 2002 at 18:13 UTC | |
by Juerd (Abbot) on Mar 14, 2002 at 18:57 UTC |