meonkeys has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Storable qw( freeze thaw ); use DB_File; use strict; my %hash = ( 1 => { desc => 'fat', states => 'WA OR ID CA', open => '0', narm => '1', }, 2 => { desc => 'fatter', states => 'NATIONWIDE OR ID CA', open => '1', narm => '0', }, ); my $frozen = freeze \%hash; my %table; tie (%table, 'DB_File', 'planners.db', O_RDWR|O_CREAT, 0666, $DB_BTREE) or die "Cannot tie: $!"; %table = ( planners => $frozen, ); untie %table;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Compression of a mini-database in memory
by AgentM (Curate) on Feb 17, 2001 at 02:33 UTC | |
|
Re: Compression of a mini-database in memory
by merlyn (Sage) on Feb 17, 2001 at 01:06 UTC | |
|
Re: Compression of a mini-database in memory
by dws (Chancellor) on Feb 17, 2001 at 01:13 UTC | |
by meonkeys (Chaplain) on Feb 17, 2001 at 01:21 UTC | |
|
Re: Compression of a mini-database in memory
by McD (Chaplain) on Feb 17, 2001 at 02:07 UTC | |
by tye (Sage) on Feb 17, 2001 at 02:29 UTC |