1.

What are references in Perl?

Answer»

A reference in Perl is a scalar data type, which can hold the location of another value that might be ARRAYS, scalar, or Perl hashes. Since references are scalar in nature, programmers can use them ANYWHERE in replacement of a scalar. For creating a reference of any variable, subroutine, or value, we can PREFIX it with a BACKSLASH

$hashref   = \%ENV;  $arrayref  = \@ARGV;  $scalarref = \$FOO;  $coderef   = \&handler;


Discussion

No Comment Found