If you are trying to delete items from the NPC when it dies during EVENT_DEATH or something like that directly on the NPC's perl script, you will need to be using $npc commands, not $corpse stuff. At that time, I don't think the $corpse entity exists yet for that NPC.
Under the NPC class, there is this quest object:
Code:
RemoveItem(item_id, quantity= 0, slot= 0)
Unfortunately, I don't see any quest object yet to find items or item slots on an NPC. One could certainly be created though easy enough I am sure. But, in the mean-time, if you know the item IDs that you want to delete, you could just do a for loop through each possible slot 0 to 25 or something and try to delete the item you want deleted. If you don't know what item ID that would be, it may get a little more complicated. You would just need to create an array of item IDs when someone hands items to the NPC then just run the for loop on each item ID in that array. Should work fine.
Removing it from the corpse itself would probably be easier, but you would need to do it from something like player.pl or something. Since you can't really use EVENT_LOOT for that (I don't think), you may just need to send a signal to another NPC when the main NPC is killed and then have a timer that waits a second (to allow the corpse to be created) then searches all corpses and removes those items at that time.