[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Some suggestions?



Greetings fellow users of the sublime MacPerl,

I'm making a CGI search engine. Any suggestions as far as fastest way to
search and optimization are appreciated.

The engine will search a list that looks like this:
("Data<TAB>Data<TAB>Data<TAB>Data","Data<TAB>Data<TAB>Data<TAB>Data").
This list will be 500 items long. Sometimes it needs to search in the
first item, sometimes the others. Usually only one item.
So i do:

foreach $item (@thelist){
@itemarray = split (/\t/,$item)
if $itemarray[0] eq $searchitem{
dosomething } 
}

I'm concerned that I could search 2000 (4x500) items before I get to one
I want. After I find that one, I will need to extract $itemarray[3]
everytime.

So how do I construct this in the quickest way possible??
Thanks pals,
Allan Greenier
AutoScript Applications

agreenier@snet.net
http://www.geocities.com/~autoscript

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org