1 |
One can think of an associative array as a simple relational database with two columns and rows labelled by keys.
|
2 |
For example, they can be used to keep data defined by MIME or HTTP format message as these protocols are defined in terms of a set of header statements
-
keyname: keyvalue with for example
-
Content-type: text/plain # corresponding to
-
$mime{Content-type} = "text/plain"; # and so on
|
3 |
Similarly this data-type can be used to store values read in arguments of a UNIX command as these are either of form
-
-keyname value # or
-
-keyname # just to indicate option set (value = yes or no)
|