MrMadScience has asked for the wisdom of the Perl Monks concerning the following question:
which means that the hash %alt_seqindex is the one I end up doing most of my searches on. It seems that building this second hash takes a very long time. I was wondering if there is a way to make that first tie statement use both the BerkeleyDB and Hash::Case::Preserve modules so that it ends up with a hash that is searchable in a case-insensitive manner?tie my %seqindex, "BerkeleyDB::Hash", -Filename => $globals{seq_xref}, -Flags => DB_RDONLY or goto bail; tie my %alt_seqindex, 'Hash::Case::Preserve'; foreach my $key (keys %seqindex){ $alt_seqindex{$key} = $seqindex{$key}; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tie one hash two ways?
by Jenda (Abbot) on Oct 01, 2004 at 17:17 UTC | |
|
Re: Tie one hash two ways?
by Fletch (Bishop) on Oct 01, 2004 at 16:13 UTC | |
|
Re: Tie one hash two ways?
by PodMaster (Abbot) on Oct 02, 2004 at 15:05 UTC |