in reply to argument to delete function

You are assuming that delete only works with scalars, which is not true:

$ perl -le'my @x = "a".."z"; print "@x"; delete @x[2,4,6,8]; print "@x +"' a b c d e f g h i j k l m n o p q r s t u v w x y z a b d f h j k l m n o p q r s t u v w x y z $ perl -le'my %x = "a".."z"; print "@{[%x]}"; delete @x{qw/c g k/}; pr +int "@{[%x]}"' w x e f a b m n s t y z u v c d k l q r g h i j o p w x e f a b m n s t y z u v q r i j o p