Programming Languages
C#
Subjective
Mar 14, 2013
Does Perl have reference type?
Detailed Explanation
Yes. Perl can make a scalar or hash type reference by using backslash operator.
For example
$str = "here we go"; # a scalar variable
$strref = \$str; # a reference to a scalar
@array = (1..10); # an array
$arrayref = \@array; # a reference to an array
Note that the reference itself is a scalar.
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts