Store hashes in a DBM file:
#!/usr/bin/perl
use warnings;
use strict;
use POSIX;
use SDBM_File;
use Storable;
my %dbm;
my $db_file="demo.dbm";
tie %dbm, 'SDBM_File', $db_file, O_CREAT|O_RDWR, 0644;
$dbm{'key'}=Storable::freeze({Name=>"John", Value=>"Smith", Age=>"42"});
my $href=Storable::thaw($dbm{'key'});
my %hash=%{ Storable::thaw($dbm{'key'}) };
Related examples in the same category