in reply to Re^5: Adding Unique Elements to Array
in thread Adding Unique Elements to Array

When I pointed out that your examples were not good code, your response was to direct me, without further explanation, to another post which had recommended the same thing based on a slight speed advantage. So I had to surmise your reasoning: if you were defending the code based on the fact that someone else did it, it's cargo cultism; if you were defending the code based on the slight speed advantage, it's micro-optimization.

The OP's question indicates a low level of experience (it is in the FAQ, after all -- perldoc -q duplicate). Novices especially need to be given good examples. You can't just throw bad examples at them without any warning. They don't have the experience they need to be able to judge for themselves.

If you didn't realize that they were bad examples, well, that's why we have the ability to respond. Everybody throws out bad answers once in a while, and having them corrected is a Good Thing.


Caution: Contents may have been coded under pressure.