# I've never really used a dbm.Well, some do, and some dont... MLDBM certainly does, though your syntax wont work. Quoting from the pod:
# They allow complicated structures, right?
$dbm{$name}{'age'} = 29;
Adding or altering substructures to a hash value is not entirely transparent in current perl. If you want o store a reference or modify an existing reference value in the DBM, it must first be retrieved and stored in a temporary variable for further modifications. In particular, something like this will NOT work properly:Instead, that must be written as:$mldb{key}{subkey}[3] = 'stuff'; # won't work$tmp = $mldb{key}; # retrieve value $tmp->{subkey}[3] = 'stuff'; $mldb{key} = $tmp; # store value
This limitation exists because the perl TIEHASH interface currently has no support for multidimensional ties.
-Blake
In reply to Re4: Database storage confusion
by blakem
in thread Database storage confusion
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |