kingman has asked for the wisdom of the Perl Monks concerning the following question:
If I have a hash that looks like this and I've managed to save it to a file called 'books.data' with lock_store:
What happens when I do this:my $x = { 'Moby Dick' => "The entire text of Moby Dick...", 'The Lord of the Rings' => "The entire text of Lord of the Rings.. +.", 'Great Expectations' => "The entire text of Great Expectations..." +, 'War and Peace' => "The entire text of War and Peace...", };
Am I reading all that data into memory at once? How hard is it on the machine if I iterate through the keys of $%books?my $books = lock_retrieve('books.data');
I'd appreciate any comments on this. I'm kind of wondering how much data is too much. Thanks for your help!my $search_string = 'ect'; foreach $title (keys %$books) { print $books->{$title} if $title =~ /$search_string/i; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Saving Large Hashes to Disk via Storable.pm
by perrin (Chancellor) on Jan 24, 2002 at 03:09 UTC | |
by crazyinsomniac (Prior) on Jan 24, 2002 at 08:08 UTC | |
|
Re: Saving Large Hashes to Disk via Storable.pm
by Rhandom (Curate) on Jan 24, 2002 at 03:24 UTC | |
|
Re: Saving Large Hashes to Disk via Storable.pm
by Ryszard (Priest) on Jan 24, 2002 at 09:38 UTC |