use Win32::Process::List; my $P = Win32::Process::List->new(); #constructor my @list = $P->GetProcesses(); #returns an array of hashes my %h = %{ $list[0] }; #get the hash with processname and pid foreach my $pr ( keys %h ) { print "Process $pr has PID " . $h{$pr} . "\n"; }