KW Perl Mongers Perl Modules: A Look Under the Hood #5

Reference Refresher

A reference represents the location of another variable or value, which is known as the referent.

      $scalar_ref = \$s;  # reference to scalar $s
      $array_ref  = \@a;  # reference to array @a
      $hash_ref   = \%h;  # reference to hash %h
      $sub_ref    = \&s;  # reference to subroutine &s

<< Previous | Index | Next >> Copyright © 2004 Daniel Allen