> b) Flat file : Create a Linux directory structure with the same hierarchy
as
> the attributes....i.e., directory structure has
> <publishers>/<sizes>/<types>/<ip numbers>. ip numbers is the file name
which
> contains a list of ads. Objective is to pick the right file, open this
file
>and create a hash with the contents of the file.
You might get better performance by using a combined key, hashing it, and
splitting into directories after the first 2 characters in the key. This
would mean 2 directories to traverse for each lookup, rather than 4. I
believe the File::Cache module works this way, so you could steal code from
there.
However, dbm is a good choice for this. You may find SDBM_File faster than
DB_File if your records are small enough for it (I think the limit is 2K per
record).
- Perrin