ppm install Win32::Process::List;
use Win32::Process::List;
my $P=Win32::Process::List->new();
my %list = $P->GetProcesses(); # returns the hashes with PID and process name
foreach my $key ( keys %list ) {
# $list{$key} is now the process name and $key is the PID
print sprintf("%30s PID %15s", $list{$key}, $key)."
";
};