Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re4: Database storage confusion

by blakem (Monsignor)
on Mar 09, 2003 at 05:57 UTC ( #241506=note: print w/replies, xml ) Need Help??

in reply to Re^3: Database storage confusion
in thread Database storage confusion

# I've never really used a dbm.
# They allow complicated structures, right?
$dbm{$name}{'age'} = 29;
Well, some do, and some dont... MLDBM certainly does, though your syntax wont work. Quoting from the pod:
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:
$mldb{key}{subkey}[3] = 'stuff'; # won't work
Instead, that must be written as:
$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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://241506]
[atcroft]: stevieb: I have berrybrew installed on a Win machine, and I noticed that with perlbrew you can "upgrade" a particular installed version... any chance of doing something similar in the
[atcroft]: future with berrybrew?
[atcroft]: stevieb: Also, one other odd question... is it possible to set it up so that all the versions installed can use a single directory that they pull module sources into, rather than duplicating files? (Am I making sense, or do I have too high a CBC
[atcroft]: (caffeine-blood content) atm?)
[atcroft]: .oO(Interesting... I just went to http://blogs.perl. org/, did a search for "Mars", and tried to go to the second page of results, and received instead a "Request-URI Too Large" message.... odd.)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-04-29 05:14 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.