Perl $$(双美元)标志 - 它取消引用了什么?

eal*_*eon 4 perl

我看到了关于Perl $$ var的问题- 两个美元符号作为一个印记?并且该双美元符号用于取消引用

我有这个perl代码

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->new(
        Listen    => SOMAXCONN,    # listen queue depth
        LocalPort => 0,
        Reuse     => 1
    );

    die "Unable to bind a port: $!" if !$sock;

    $port      = $sock->sockport();
    my $ip = inet_ntoa( scalar gethostbyname( $HOST ));
    my $uid = (getpwuid( $> ))[2];
    my $queue = join(":", $ip, $port, $$, $uid);

    print sprintf("started on port $port ($$), SOMAXCONN=%d\n", SOMAXCONN);

    return $sock;
} ## end sub sock_initialize
Run Code Online (Sandbox Code Playgroud)

从上面的代码,双美元符号解除引用是什么? my $queue = join(":", $ip, $port, $$, $uid);

F. *_*uri 10

只是

喜欢在和其他:当前进程id(PID)POSIX $$

用于man perlvar:

  $PROCESS_ID
  $PID
  $$      The process number of the Perl running this script.  Though you can
          set this variable, doing so is generally discouraged, although it can
          be invaluable for some testing purposes.  It will be reset
          automatically across "fork()" calls.
Run Code Online (Sandbox Code Playgroud)

诺娜:来自 man perl

Reference Manual
        perlsyn             Perl syntax
        perldata            Perl data structures
        ...
        perldebug           Perl debugging
        perlvar             Perl predefined variables
        ...
Run Code Online (Sandbox Code Playgroud)

man POSIX......

   "getpid"
          Returns the process identifier.  Identical to Perl's builtin
          variable $$, see "$PID" in perlvar.
Run Code Online (Sandbox Code Playgroud)