in reply to How to get PID of a process given its complete command line in windows

The easiest way is to do that using WMI. A bit of Googling tells me that you can get the command line of any process using WMIC:

WMIC PROCESS get Caption,Commandline,Processid

Then, you just have to go through all lines in your script and you have the process id.

See perlop for how to get the output of another process.

Maybe you want to use DBD::WMI to avoid running an external program. Most likely, the SQL would be

SELECT Caption , CommandLine , ProcessId FROM Win32_PROCESS