Q: getting my own process id? 
Author Message
 Q: getting my own process id?

What is the easiest way for a perlscript to get it's own process id?
Running on linux or unix.

-Thomas ?



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: getting my own process id?

Quote:

> What is the easiest way for a perlscript to get it's own process id?
> Running on linux or unix.

$$

see perlvar

Quote:

> -Thomas ?

--
Bob Walton


Wed, 18 Jun 1902 08:00:00 GMT  
 Q: getting my own process id?

Quote:

>What is the easiest way for a perlscript to get it's own process id?
>Running on linux or unix.

If you check the perlvar man page (maybe by using perldoc) then you will find:

       $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.  (Mnemonic: same as shells.)

Hope this helps,

Mike

--

http://www.stok.co.uk/~mike/       |
GPG PGP Key 1024D/059913DA         | Fingerprint      0570 71CD 6790 7C28 3D60



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Q: getting my own process id?

2. Forking processes (getting child process id)

3. Getting Process ID of new process in system call

4. Getting Process ID of new process in system call

5. Getting the parent process id in perl???

6. trouble getting process ID's

7. getting process id from open on NT

8. Getting process id

9. to get the process ID of a running process

10. Process id for fork()ed process

11. Getting id for MSSQL2000 newly inserted record

12. Getting Autonumber ID after insert

 

 
Powered by phpBB® Forum Software