Without testing either of these, I suspect that you have two options: (1) iterate through the retrieved hash, inserting key/value pairs into a newly-created Hash::Case::Lower object; or (2) go behind the back of Hash::Case::Lower to both dump out the hash, and load it back in.
The former is straightforward, and probably looks something like this:
tie my(%lc_hash), 'Hash::Case::Lower'; { my $href = retrieve( ... ); while ( my ( $k, $v ) = each %$href ) { $lc_hash{$k} = $v; } }
Although, if you're going through the whole thing anyway, there's no problem in applying lc to all the values manually. Might be faster...
To go behind its back, you will want to save it directly; the only fancy footwork should be a bless when you read it back in. (This might not even be necessary — I don't know how clever Storable is, really.)
# writing it out store( \%lc_hash, ... ); # reading it in my $lc_href = retrieve( ... ); bless $lc_href, 'Hash::Case::Lower';
All the above is untested, but hopefully it will give you some ideas to play with! :)
In reply to Re: using Hash::Case and Storable together
by tkil
in thread using Hash::Case and Storable together
by agaffney
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |