Sorry, possibly on either Linux, UNIX or Windows. I was hoping there was a portable way of doing it from within Perl. If not, could you provide any OS specific examples?
Well on windows the perl processes all get started as perl.exe (with activestate anyway). On Linux/Unix they start as the program name /path/to/program.pl.
You can do a @proc = `ps -ef`; to get all the processes on a linux/unix box. You can then grep for the program to find it there.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
I've used a portion of the downloadable program quite successfully on the Win OS to look for rogue programs running on PCs. If you are in the market for it, build yourself a database of:
$prog_list{'good'}{$prog_name} = "some comment";
$prog_list{'bad'}{xx} = "some comment";
$prog_list{'dont_know'}{xx} = "some comment";
put this and a copy of perl.exe onto a pen/thumb/flash/other drive and you more or less have the beginning of a traveling road show. (Everyone out there raise your hand/keyboard if you've ever heard the following "Hey - you work with computers? Can you stop by the house and ....")
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.