in reply to Re: pondering array population
in thread pondering array population

IMO, a hash would be overkill.

Far less than repeatedly grepping through an array with regular expressions. Either the number exists in the hash or it doesn't. The check takes the same amount of time regardless of the number of elements in the hash (modulo hash bucketing, a subject I really don't want to discuss). With a grep, every new number you add to the array will be checked, every time. The regex is worse, because it has to compile the regex for each parameter and fire up the regex engine for every number checked.

On the other hand, if you mean "it would be overkill for me to use a hash because I don't understand them and I do understand grep," that makes sense. Except now you do know why to use a hash. :)