http://qs321.pair.com?node_id=759905

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

I have a need to retrieve the handle, (processid) from win32processinfo for vugen.exe, I am not sure how to get it out of the array, this is so i can pass it to another module for monitoring a process. update ..doh a cpan search yields win32 processlist..I can probably use this for the task..
use Win32::Process::Info; use Data::Dumper; $pi = Win32::Process::Info->new (); $pi->Set (elapsed_in_seconds => 0); # In clunks, not seconds. @pids = $pi->ListPids (); # Get all known PIDs @info = $pi->GetProcInfo (); # Get the max %subs = $pi->Subprocesses (); # Figure out subprocess relationships. @info = grep {$_->{Name} =~ m/vugen/} $pi->GetProcInfo (); # All processes with 'vugen' in name. #print $info; #print $pi; #my $href=\%subs; #print Dumper $href; print Dumper @info; #print Dumper @pids;