On December 15th, 2002, Komtanoo Pinpimai wrote:
>         I wonder if "perl list" provides function for 
> searching elements !? I think it is not good to do a 
> bruteforce search in an unsorted array. If Perl list is 
> built basing on data structures that enhance searching, 
> it is possible to provide built-in fuction for searching !?

Dude, could you, like, fix your clock?

have you tried a simple hash to see if it explodes
your memory? do you really have too much data to
fit in your hardware? If your concern is future
expansion will break your code, then you should 
be thinking about how to encapsulate your search
so that you can change the implementation without
having to change the interface.

i.e. design an OO perl package that has methods
for doing searches, that hides the underlying
data structure (hash, array, magic beans).

use encapsulation to enforce the implementation.
check out encapsulation via scalars for iron-clad
encapsulation that prohibits peeking at the
internals of an object.

Then, code the thing up using a simple hash,
since it didn't sound like space was a real
problem right now. When/if the thing
expands to the point where it is too huge
to use simple hashes, change the implementation
without changing the interface.

Greg
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to