#!/usr/bin/perl
use strict;
use warnings;
use Win32::Process;
use Win32::Process::Info;
my $pi = Win32::Process::Info->new;
my @procs = $pi->GetProcInfo();
foreach my $p (@procs) {
print $p->{Name}, " Pid: ", $p->{ProcessId}, "\n";
if(index($p->{Name}, "excel") > -1) {
Win32::Process::KillProcess($p->{ProcessId}, 255);
}
}