# First, but @items into a hash instead though... my @array = qw(dog cat cow horse donkey chicken); my %items = qw(cat 1 donkey 1); # this is weird.. if this is true print "\$array[-4] = $array[-4]\n"; for (1..@array) { splice(@array, -$_, 1) if $items{ $array[-$_] }; } # and this is true print "\$array[-4] = $array[-4]\n"; # how come this is right??? print join ', ',@array, "\n";