1 # Copyright (C) 2007-2009, Parrot Foundation.
4 =head1 Multi-Level Keys
6 Hashes and arrays can be combined in a number of ways to
7 make interesting and complex data structures. A hash may
8 contain an array PMC, which in turn can contain other arrays
9 or hashes. In these cases, the keys for each level can be
10 combined together to form a single unique key for a data
11 element in the structure.
13 This technique works equally well for arrays-of-arrays,
14 hashes-of-hashes, and combination structures as well.
20 .local pmc myhash, innerarray
22 innerarray = new ['ResizableIntegerArray']
26 myhash["answer"] = innerarray
28 $I0 = myhash["answer";$I0] # $i = $hash{"answer"}[2]
38 # vim: expandtab shiftwidth=4 ft=pir: