in reply to Re^2: how can a perl script determine it's own PID while running
in thread how can a perl script determine it's own PID while running

i'd suggest making a /var/run/yourProgram.run file that containts the PID of your script, like so many other UNIX programs have. Have the file deleted when your script exits. then have your other script monitor that file.
  • Comment on Re^3: how can a perl script determine it's own PID while running

Replies are listed 'Best First'.
Re^4: how can a perl script determine it's own PID while running
by suaveant (Parson) on Aug 14, 2006 at 21:11 UTC
    Though if your script gets severely trashed a la kill -9 the file would still be there. Usually you are best off combining the pid file with a kill check... or a check for the proc dir.

                    - Ant
                    - Some of my best work - (1 2 3)

      That's why you don't just check for the file. If the file exists, you read the process's pid from the file and then check for the process.