 <p>You can also fudge multi-dimensional arrays if you always have all of the key values, or you just don't need to access the individual levels as separate arrays:</p> <pre><code>$arr{"foo",1} = "one"; $arr{"bar",2} = "two"; while(($key, $value) = each(%arr)) { @keyValues = split($;, $key); print "key = [", join(",", @keyValues), "] : value = [", $value, "]\n"; } </code></pre> <p>This uses the subscript separator "$;" as the separator for multiple values in the key.</p>