in reply to Re: Re: Re: Re: DBM
in thread DBM

From the docs:

Declaring an MLDBM hash:

use MLDBM; use Fcntl; $dbm = tie %o, 'MLDBM', 'testmldbm', O_CREAT|O_RDWR, 0640 or die $!;
and modifying an item:
$tmp = $mldb{key}; # retrieve value $tmp->{subkey}[3] = 'stuff'; $mldb{key} = $tmp;
which in your case would be something like:
use MLDBM; use Fcntl; $hash = tie %o, 'MLDBM', 'testmldbm', O_CREAT|O_RDWR, 0640 or die $!; ... $tmp = $hash{$nameplace}; if ($male) { $tmp->{$person}[0]++; } else { $tmp->{$person}[1]++; } $hash{$nameplace} = $tmp;
(note this is untested...)

rdfield