in reply to passing multi dimensional hashes into a sub
Remember, Perl really has only three data structures: hashes, arrays, and lists. Each can only contain scalars ... of the same or different types. But, a reference is a type of scalar, which can point to anything, and it is by this mechanism that Perl is able to create arbitrary data structures. Thus, from Perl’s point of view, you are passing the sub “a reference to a hash (a ‘hashref’), each bucket of which contains a reference to an array (an ‘arrayref’) of integers.”
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing multi dimensional hashes into a sub
by AnomalousMonk (Archbishop) on Sep 17, 2015 at 19:24 UTC |