1 |
An associative array is a "software implemented" associative memory where you can fetch values by names or attributes or technically keys
|
2 |
An associative array is a set of pairs (key,value).
|
3 |
The whole array is referred to as %dict and is typically set with instructions like
-
$dict{keyname} = value; # NOTE Curly braces {} to show array associative
|
4 |
The values can be used in ordinary arithmetic such as
-
$math{pi}=3.14; $math{pi} += .0016; # sets $math{pi}=3.1416;
-
pi or "pi" is allowed for specifying key
|
5 |
If key pimisspelt has not been defined then $math{pimisspelt} returns undef as value and so one can easily see if a particular key has been set.
|
6 |
Alternatively function exists($math{pimisspelt}) returns false unless key pimisspelt has been set
|