title: Shared Hashref of hashes possible?
body: <p>Im trying to use a hashref of hashes to store a persistant field and a timestamp of when that field was changed.</p>
  
  <p>It needs to be shared though as I have 2 threads that are required to access it although only one sets the values.</p>
  
  <p>here is my current code with several commented out variations:</p>
  
  <pre><code>my $status = {};
  share($status);
  sub get_status {
      my($raid) = @_;
      return $status-&gt;{$raid}-&gt;{status} if exists $status-&gt;{$raid};
      return 1;
  }
  sub set_status {
      my($raid,$newstatus) = @_;
      my %t;
      $t{status} = $newstatus;
      $t{timestamp} = Time::HiRes::time;
      $status-&gt;{$raid} = \%t;
      #$status-&gt;{$raid} = {
          #status =&gt; $newstatus,
          #timestamp =&gt; Time::HiRes::time()
      #};
      #$status-&gt;{$raid}-&gt;{status}=$newstatus;
      #$status-&gt;{$raid}-&gt;{timestamp} = Time::HiRes::time;
      return 1;
  }
  set_status('680','1');
  get_status('680');
  </code></pre>
  
  <p>I continually get <code>Invalid value for shared scalar at ./hashtest line 19.</code></p>
  
  <p>Could anyone help please :D?</p>