in reply to ps in perl?

Alternatively, if you are looking for something that runs on Win32, Win32::Process::List would appear to be a good candidate.