Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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]
[marto]: Corion They don't get into trouble for the number of tickets, or even breached tickets they have
[marto]: which is a core issue with the client
[Corion]: marto: Yeah, I can imagine that
[choroba]: create a ticket if the number of tickets reaches a limit
[choroba]: how deep meta could it go?
[marto]: this sounds like a sub section for Sane Dots

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-01-24 10:20 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (203 votes). Check out past polls.