my $array_ref = \@array;
my $hash_ref = \%hash;
Is that the case?
What's happening there is that you're taking
a reference to an array and a hash. References are described in
perlref. They're kind of like C pointers, but also kind
of not. :)
References are scalars that "point" to other variables--the
other variables can be arrays, hashes, scalars, etc. To use
the variable pointed to by a reference, you have to
dereference the reference. This could also be what you
were referring to by $$, because if we had a reference
to a scalar, like this:
my $string = "foo bar";
my $ref = \$string;
then we could get access to the value "foo bar" by
dereferencing $ref, like this:
my $original = $$ref;
$original now contains "foo bar".
So take a look at perlref and also at
perlreftut,
which might actually be a better place to start than perlref, depending
on your experience. |