1 |
keys(%dict) returns a list (conventional array) of keys in %dict ( in arbitrary order). This can be used with foreach construct
|
2 |
foreach (keys(%mime)) { # $_ will run through keys
-
print "In dictionary we have key $_ as $mime{$_}\n";
-
}
|
3 |
values(%dict) is typically less useful. It returns a list of values (which may be repeated) in any order in associative array %dict
|
4 |
each(%dict) returns a single two element list containing the "next" (key,value) pair in %dict.
-
Each call to each(%dict) returns a new such pair until all are cycled through.
-
Finally each will return a null (undefined) list.
-
After this, next call to each will start the cycle again through the entire list of pairs in %dict
|