How To Understand A Hash
Computing : Learning Perl If you haven't worked with Perl before, you may be unsure as to exactly what a hash is. Well, a hash is simply an unordered collection of values, each of which is identified through a key, which is unique. Therefore you can think of a hash as a lucky dip - there are lots of items stored in the barrel of sawdust, and each one has a unique tag attached. So, you may have the word "keyring" in the barrel twice (value) but each will have a unique identifier attached, perhaps "plastic" and "metal". You don't know the order, but you do know that they relationship between a key and the value will always be the same.
Questions about Learn Perl:
|
|