You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
340 B
Perl

#!/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'}) };