in reply to Pushing unique items onto an array
Using an array for that isn't scalable as your search time will be linear. The better way to do it is to use your links as hash keys.
If you absolutely must keep an array, keep both an array and a hash. Something like this will do the trick.
push @array, $item unless $seen{$item}; $seen{$item}++;
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Pushing unique items onto an array
by Anonymous Monk on May 30, 2003 at 17:16 UTC | |
by sauoq (Abbot) on May 30, 2003 at 17:27 UTC | |
by sauoq (Abbot) on May 30, 2003 at 17:43 UTC |