in reply to using perl to stop processes on windows

Lookup the pskill utility available on the sysinternals site. This should do what you want. You can use Perl to drive this tool.