Saturday, January 8, 2011

Six Types of References

Reference Assignment How to Dereference
$refScalar = \$scalar; ${$refScalar} is a scalar value.
$refArray = \@array; @{$refArray} is an array value.
$refHash = \%hash; %{$refHash} is a hash value.
$refFunction = \&function; &{$refFunction} is a function location.
$refGlob = \*FILE; $refGlob is a reference to a file handle and seems to be automatically dereferenced by Perl.
$refRef = \$refScalar; ${${$refRef}} is a scalar value.

No comments: