http://www.perlmonks.org?node_id=2867

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

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on How do I examine the status of a process?

Replies are listed 'Best First'.
Re: How do I examine the status of a process?
by stephen (Priest) on Feb 05, 2000 at 05:15 UTC
    In general, you can use "kill" with signal number zero to check on the existence of a process. See 'man perlipc' for details. Here's code:
    use strict; MAIN: { my $pid = $ARGV[0]; if (kill 0 => $pid) { print STDOUT "Process '$pid' exists\n"; } else { print STDOUT "Process '$pid' does not exist\n"; } }
Re: How do I examine the status of a process?
by IndyZ (Friar) on Feb 07, 2000 at 06:37 UTC
    Hope you can get that capslock key fixed. I recommend prying it off with a screwdriver, then using a little rubbing alchohol to loosen up the dirt.
      it's wise just to avoid using it altogether, i think. -e. e. cummings
        it's wise just to avoid using it altogether, i think. -e. e. cummings

        that and that pesky period key - e e   cummings
Re: How do I examine the status of a process?
by Anonymous Monk on Feb 04, 2000 at 22:28 UTC

    depends - which OS are you using? If you're using some *nix try this:

    ps aux | grep perl

Re: How do I examine the status of a process?
by Anonymous Monk on Feb 05, 2000 at 09:46 UTC
    There is a pm out there that will do this. Nice little package. However, I have forgotten where it is. Could be useful.