First, check out http://www.perlmonks.org
Now on to your question: the variable $ref
- Is a scalar (since "$foobar")
- Which contains a reference to an array (i.e. an "arrayref"),
- Each element of which is a reference to a hash (a "hashref").
In Perl, an array
is a one-dimensional structure whose elements are accessed by a zero-based numeric index.
is a one-dimensional structure whose elements are accessed by string key-values, such as (in this case) "Shu," "Haa," and "Zee."
is simply "a thing," specifically a scalar thing, which "refers to" something else ... that is to say, "indirectly." A reference can refer to any sort of thing.
It is a good idea to prefix all programs with: use strict; use warnings;
. Do this as a strict matter of routine, every
time. Perl is otherwise "do what I (think you) mean." It can allow you to write stuff that isn't what you thought you were writing, unless you, in this way, ask for
more stricture and warnings. Do so.