Документация Perl 5

$$

  • $PROCESS_ID
  • $PID
  • $$

    The process number of the Perl running this script. You should consider this variable read-only, although it will be altered across fork() calls.

    Note for Linux users: on Linux, the C functions getpid() and getppid() return different values from different threads. In order to be portable, this behavior is not reflected by $$, whose value remains consistent across threads. If you want to call the underlying getpid(), you may use the CPAN module Linux::Pid.

    Mnemonic: same as shells.

 
Разделы документации
Внешние ссылки