in reply to References Explanation

my $array_reference = \@array;
That assigns a reference to @array to $array_reference where the reference is created by putting the backslash in front of @array.
print "COLOR: $$array_reference[3]\n";
Dereference $array_reference (done by adding the second $ sigil) and access the 4th element.
foreach (@$reference) { print "IN THE SUB: $_\n"; }
Loop over the list created by the dereferenced array referenced by $reference and print out each element.

For a good start on references and dereferencing see. tye's References quick reference and perlreftut.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: References Explanation
by Anonymous Monk on Jun 26, 2003 at 14:25 UTC
    Thank you to both of you for telling me how this works!