Win32-Process-List reviews

RSS | Module Info

Win32-Process-List (0.09) ****

This module gives a list of processes and PID numbers on Windows. It is an interface to an XS module which calls native Windows routines. The module works on Windows and also Cygwin.

I downloaded this module in order to write a script which would detect a running Emacs process. As an experiment, I used it to make a script to kill off all instances of Google Chrome.

See for the code.

This worked OK to zap all the Chrome processes. However, I noticed that:

* the actual list of processes is created by "new". "GetProcesses" returns an array that was created by "new". This could catch you out if you have a script running for some time and the process list changes, because GetProcesses will return the list of processes at the time "new" was called.

* The functions described in the documentation don't have the documented behaviour. For example, GetProcessPID returns a hash, not a scalar as described. This function doesn't seem to work, though, so the SYNOPSIS program doesn't run anyway.

* It may be easier to just access the undocumented XS function ListProcesses. In the above example,

my %list = %{ Win32::Process::List::ListProcesses(undef) };

gets the same result.

So, although it works well enough, the module doesn't have proper documentation and the documented functions in it all seem to be "fake-o".