next up previous contents
Next: Operators Up: Associative Arrays Previous: Associative Arrays

Associative Array Operators

keys()

The keys(%arrayname) lists all the key names in a specified associative array. The answer is returned as an ordinary index array.

E.g.

@names = keys(%lookup);

values() This operator returns the values of the specified associative array.

E.g.

@codes = values(%lookup);

delete deletes an associated key and value by key reference, e.g.

# scrub adam from code list
delete $lookup("adam");


dave@cs.cf.ac.uk