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

Re: [MacPerl] Some suggestions?



Greetings,
Lotsa suggestions from people, thanks. I'll be looking them over.
A little more detail.

I've got 3 lists to search...the first two are small so I'm not worried.
The last is much larger.
We've got:
Vendors
Familys
Models

The Familys have Vendors.
The Models have Vendors and Familys.

@Vendorlist looks like this:
(Vendor<Tab>VendorHTMLname,Vendor2<Tab>Vendor2HTMLname)

Similarily @Familylist looks like this:
(Family<Tab>FamilyHTMLname,Family2<Tab>Family2HTMLname)

While @Modellist looks like this:
(Vendor<Tab>Family<Tab>Model<Tab>ModelHTMLname,Vendor2<Tab>Family2<Tab>Model2<Tab>Model2HTMLname)
The HTMLname's are so I can construct HREF's from the arrays.

So you input a Model, I search the @Modellist for any and all matches.
Then using those matches, I search  the @Vendorlist for Matches and the
@Familylist for matches.
I use all returned data to construct a table of links (imagine HREF
underlines below)

<TR><TD>Vendor1</TD><TD>Family1</TD><TD>Model1</TD></TR>
<TR><TD>Vendor2</TD><TD>Family2</TD><TD>Model2</TD></TR>

I kept the @Vendorlist and @Familylist searchlist separate for
efficiency-
there's 500 models, 50 familys and 10 vendors.

I guess I can't quite figure how a hash is the answer...because the
search is by key? But doesn't Perl have to go through all the keys just
like it would a list?

On a related note, how can I get 
grep(/$question/,@filelist)
or simply =~ /$question/$findString
to ignore case while pattern matching?

This is such a great digest...everyone's so helpful and enthusiastic!

Allan Greenier
AutoScript Applications
597 Central Ave.
New Haven, CT 06510
203-389-8212
agreenier@snet.net
http://www.geocities.com/~autoscript

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