Enter.. HASHES! I'm really horrible at hashes, and I try to stay away from them as much as possible, but I think it is now time for me to give in and learn them.On the user end, your end, the only difference between a hash and an array, is that one is ordered and uses number keys, and the other uses arbitrary key values. A key value being what goes in between the [] or {}. If you are good with arrays, you are good with hashes, so don't be too hesitant. Oh, and hashes can autovivify. Checking for $x{$y} creates the key,value pair $y,undef, so you'd use exists($x{$y}) instead. A minor thing.
Under the hood is where it starts to get complex, such as auto vivication, what they key really represents: an index or an arbitrary value which gets converted into a "unique" value etc. (you can have collisions, but they are uber rare)
The same problems you have with hashes, can occur in arrays, i.e. how you nest them and what's in nesting them.
In reply to Re: A Hash is a Hash (of course, of course)
by exussum0
in thread A Hash is a Hash (of course, of course)
by hacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |