|
|
|
|
|
by simcop2387
2513 days ago
|
|
Not quite, references were introduced in perl 5, in perl 4 and earlier had a different method that wasn't quite multi-dimensional arrays but tried to behave that way. $hash{1,2,3} = 10;
This actually ends up doing the following $hash{join($;, 1, 2, 3)} = 10;
It builds up a single key from the list using the special variable $; as a separator to the elements. With perl 5 you gained the ability to make references which allow you to actually make multiple dimensions and to do it on arrays, not just hashes. $array[1][2][3] = 10;
That also allows for more complicated data structures and much easier ways to iterate through the structures. |
|