http://www.perlmonks.org?node_id=791467


in reply to difference between pointer and referrence in perl

In addition to arrays, hashes, and scalar references you also have:
  1. subroutine references.
  2. typeglob references.
  3. references to lists (distinct from references to arrays).
  4. IO references.
  5. LVALUE references.

one distinguishing feature of Perl, not available in C involves DYNAMIC creation of data structures and prevents excessive typing, this feature is called Autovivification, in reference view, a reference springs to existence if it is dereferenced under the assumption that it exists. With this in mind, you would notice that Perl references and C pointers are not exactly the same.

EXAMPLE: (Note the reference is held in the scalar value $reference!) $$reference=5; #Dereferencing before creating a reference. print "$$reference\n"; #Creation of $reference autovivifically. print "$reference\n";

Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.