title: how to create perl aliases? typeglobs?
body: <p>Suppose I'm manipulating a hash that's in another package, and I want to create an alias to that variable?  What's a clean way to do that?  This sample code shows what I want to do, but it, and a dozen variations of it malfunction.</p>
  
  <pre><code>#!/usr/bin/perl
  #use strict;  # I want it to work with strict.
  
  my $p = Person-&gt;new("Joe");
  my $name;
  *name = \*$p-&gt;{"name"};     # Latest broken attempt
  
  printf("'%s' should eq '%s' because they both point to the same place.\n",
         $name, $p-&gt;{"name"});
  
  $name = "Sam";
  
  printf("'%s' should eq '%s' because they both point to the same place.\n",
         $name, $p-&gt;{"name"});
  exit 0;
  
  
  package Person;
  
  sub new {
      my $class = shift;
  
      my $this = {};
      bless $this, $class;
  
      $this-&gt;{"name"} = shift;
  
      return $this;
  }
  </code></pre>
  
  <p>The functionality I want is to be able to manipulate <code>$p-&gt;{"name"}</code> dozens of times without having to type <code>$p-&gt;{"name"}</code> repeatedly.  The real data structure is far more complex with a lot of nested hashes.</p>
  
  <p>It's probably something easy.
  Thanks.</p>