vsailas has asked for the wisdom of the Perl Monks concerning the following question:

I cam across this line.

$uniqueid = sprintf("%05d%04d", $$, $curid);

What does $$ here signify, Is it a process id? As when tested i was getting a random 4 digit number every time for $$.

Advance thanks for help!!!

Edit: g0n - code tags

Replies are listed 'Best First'.
Re: $$ Question
by ikegami (Patriarch) on Nov 15, 2007 at 06:15 UTC

    Yes, $$ is the process number.

    In Windows, it can also be a negative number. That indicates the current process is really a thread created using the fork emulation.

      Thank you!
Re: $$ Question
by tilly (Archbishop) on Nov 15, 2007 at 06:04 UTC
    As perlvar says, $$ is indeed your process ID.