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