[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MLDBM crashes MacPerl



Hi! After 3 years of absence I've resubscribed to the list :-) Here's my
problem:

I have to use the MLDBM 2.00 module to store complex data structures.
However, when I try to modify a key's value, MacPerl patch level 5.004
version 5.20r4 crashes with a type 2 error. The following code will crash
when run the second time:

use MLDBM qw(DB_File);
tie (%TEST, 'MLDBM', 'test.dbm')
  or die "Cannot open: $!\n";
$TEST{'foo'} = 'bar';
untie %TEST;

same for delete($TEST{'foo');

Now as my data isn't sooo complex, I use dbmopen with hashes as a
workaround like this:

$TEST{'name', 'phone'} = $phone;

*But* in my script, the user may use keys the script cannot know in
advance, and as it turns to be a CGI the script forgets the keys after a
run, which prevents me from deleting entries with such unknown keys later.
Is there a safe and easy way to get all keys based on a "first" key? (Like
in the above example, retrieve any key combinations used after the 'name'
key, here ['name', 'phone'], based on the 'name'?)

Hints on any of the two problems welcome.

Best regards,

Erich



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org