Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: millions of records in a Hash

by jeffenstein (Hermit)
on Feb 24, 2002 at 18:18 UTC ( [id://147187]=note: print w/replies, xml ) Need Help??


in reply to millions of records in a Hash

You mention trying DB_File to store the hash. Did you use your posted with DB_File?

If you used your posted code, none of the data would have actually ended up in the database. What you would want to do is to use split/join (or Storable for that matter) to turn your array into a string, and store that in the database, something like this:

my $data = $Hash{$a}; my @elt = split /::/, $data; # Do stuff with @elt here. # push @elt, $new_data to add data $data = join '::', @elt; $Hash{$a} = $data;

This way, your database won't be just the reference to the data in memory, your data will actually reside on disk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://147187]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-04-19 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found