title: What does $$ in perl actually return?
body: <p>I'm new to Perl, learning from the beginning. I've read that <code>$$</code> returns </p>
  
  <blockquote>
    <p>The pid of the Perl process running this script.</p>
  </blockquote>
  
  <p>as per below link,</p>
  
  <p><a href="http://www.tutorialspoint.com/perl/perl_special_variables.htm" rel="nofollow">http://www.tutorialspoint.com/perl/perl_special_variables.htm</a></p>
  
  <p>I've the following Perl Script which is being executed on a Windows machine,</p>
  
  <pre><code>sub test
  {
      my ($surrogate_name) = @_;
      if((defined $surrogate_name) &amp;&amp; ($surrogate_name == 1))
      {
          print "Done!"."\n";
      }
      return $surrogate_name;
  }
  
  sub t
  {
      my ($surrogate_name) = @_;
      my $record;
      my $surrogate_value;
      $record = &amp;test($surrogate_name);
      print $record."\n";
      if ($record)
      {
          print "B"."\n";
          $surrogate_value = $$record{$surrogate_name};
      }
      print $surrogate_value."\n";
      print "A"."\n";
      return $surrogate_value;
  }
  
  &amp;t(1);
  </code></pre>
  
  <p>In this code, I observed everything is printed except the value of <code>$surrogate_value</code>.</p>
  
  <p>Please clarify me what does <code>$$</code> actually mean and why it's not returning anything in my script.</p>
  
  <p>Thanks in advance...</p>