-2

I am using two hashes to store content from files, however instead of using memory I would like to store hash over the disk, could some suggest the logic on how to utilize db module.

( I just need the logic/references so that I can further work on it )

#!/usr/sbin/perl
use strict;
use warnings;
use Data::Dumper;

my %hash1;
my %hash2;


while (<>) { 
        some statements...
        some statements...
        push @{$hash1{$pull1}}, $time1;

        some statements...
        push @{$hash2{$pull2}}, $time2;
}
4

1 回答 1

1

Maybe simplest possible: DB_File. It's included in Perl standard modules, and doesn't need anything.

In case you need "serious" database - you will need DBI module, and some DBD:: driver.

于 2013-06-17T14:24:43.143 回答