--- Paul <[EMAIL PROTECTED]> wrote:
>
> --- Tom Allison <[EMAIL PROTECTED]> wrote:
> > My first guess is to use "tie" to access a file of type DB_File.
> > The number of records is small <1000 but the record structure is
> > going to be either a hash of hashes, hash of arrays, or similar.
>
> One possible solution depends on your data structure.
> Frequently hashes of hashes are convenient, but can
> eat up a lot of memory and program speed when they
> get large. On the other hand, if your keys allow it,
> you can often compund the *keys* and end up with a
> single hash, which is easily storable via DBM. e.g.:
>
> my %h;
> for my $l ('a'..'z') {
> for my $n (0..9) {
> $h{$l}{$n} = $someData;
> }
> }
>
> That's hard to store with a DBM because the hash is in layers.
> but:
>
> my %h;
> for my $l ('a'..'z') {
> for my $n (0..9) {
> $h{"$l\t$n"} = $someData;
> }
> }
>
> That stores easily in a DBM, and only requires that you
> correctly rebuild the key later. Use a standard delimiter
> (I like tabs, but there are all sorts of options) and
> you can read the keys and use split() to extract pieces,
> etc.
>
> HTH,
> Paul
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]