title: Perl $$ (double dollar) sign -- what does it dereference?
body: <p>I saw the question on <a href="https://stackoverflow.com/questions/22619917/perl-var-two-dollar-signs-as-a-sigil">Perl $$var -- two dollar signs as a sigil?</a> and that double dollar sign is used to dereference</p>
  
  <p>I have this perl code</p>
  
  <pre><code>sub sock_initialize {
  
      my $sock  = q{};
      my $port  = q{};
  
      # $name running
      my $max_count   = 250;
      my $timeout     = 5;
      my $max_retries = 36;
  
      # Get a port for our server.
      $sock = IO::Socket::INET-&gt;new(
          Listen    =&gt; SOMAXCONN,    # listen queue depth
          LocalPort =&gt; 0,
          Reuse     =&gt; 1
      );
  
      die "Unable to bind a port: $!" if !$sock;
  
      $port      = $sock-&gt;sockport();
      my $ip = inet_ntoa( scalar gethostbyname( $HOST ));
      my $uid = (getpwuid( $&gt; ))[2];
      my $queue = join(":", $ip, $port, $$, $uid);
  
      print sprintf("started on port $port ($$), SOMAXCONN=%d\n", SOMAXCONN);
  
      return $sock;
  } ## end sub sock_initialize
  </code></pre>
  
  <p>from the above code, what does double dollar sign dereferencing? <code>my $queue = join(":", $ip, $port, $$, $uid);</code></p>