in reply to Re: Testing for a string value within an array
in thread Testing for a string value within an array
It also does a full linear search of the entire list of items (which has to be copied onto the stack for each myExists call) if the element isn't already present. Replacing an O(N)-ish exists $seen{$key} with something exponential doesn't sound like it's worth any supposed simplification.
Not wanting to use a hash for keeping track of set membership in Perl is in the same vein as people who want to do iterative-task-foo without using foreach or map. Learning the idioms will make your life much easier.
|
|---|