you're wanting to use something more like this, where @findThese is a list of itemIDs you are looking for and @lookIn is a lost of slotIDs you want to look in.
Code:
foreach my $findThis (@findThese) {
foreach my $slotID (@lookIn) {
if ($client->GetItemIDAt($slotID) == $findThis) {
$client->DeleteItemInInventory($slotID);
}
}
}
but then you probably also want to be aware of items in a stack as well.