#And the code that should delete all the invalid input: my $i; foreach $i (@delete) { $query->delete($i); }