Problem with MLDBM Module 
Author Message
 Problem with MLDBM Module

I am getting the following error when trying to set a value in a hash of
hashes which has been tied to a dbm file when the particular entry I am
trying to set was previously undefined.

In somewhat more comprehensible form:

I have a hash of hashes which I tie to a dbm file using MLDBM.  I save a
bunch of data into it, and untie it.  Later, I tie it again, and update
some of that data.  Everything works fine up to this point.

If one of the items I wish to update is undefined, I get the following
error when I assign it:

sdbm store returned -1, errno 22, key "961104" at
/usr/local/lib/perl5/site_perl/MLDBM.pm line 88, <LOG> chunk 99.

To be more specific, here is some code:

use MLDBM;
use AnyDBM_File;
use Fcntl;

tie %dates, MLDBM, "$STATSFILE.dates", O_CREAT|O_RDWR, 0666;
$tmp = $dates{1};
$tmp->{a} = 10;
$dates{1} = $tmp;
untie %dates;

tie %dates, MLDBM, "$STATSFILE.dates", O_CREAT|O_RDWR, 0666;
$tmp = $dates{1};
$tmp->{a} = 20;
$dates{1} = $tmp;       # This is ok
$tmp->{b} = 50;
$dates{1} = $tmp;       # This produces aforementioned error
untie %dates;

Any ideas?

Thanks.

Kevin



Sun, 23 May 1999 03:00:00 GMT  
 Problem with MLDBM Module

Dear Kevin,

I'm getting a similar error using NDBM.  In my case the
value for errno is 9.

I just posted something about this to comp.lang.perl.misc
before I read your article.

Regards,

Mick



Mon, 24 May 1999 03:00:00 GMT  
 Problem with MLDBM Module

 [ mailed and posted ]


Quote:

>I have a hash of hashes which I tie to a dbm file using MLDBM.  I save a
>bunch of data into it, and untie it.  Later, I tie it again, and update
>some of that data.  Everything works fine up to this point.

>If one of the items I wish to update is undefined, I get the following
>error when I assign it:

>sdbm store returned -1, errno 22, key "961104" at
>/usr/local/lib/perl5/site_perl/MLDBM.pm line 88, <LOG> chunk 99.

Hmm.

    % perl -le 'print $!=22'
    Invalid argument

I'll bet the key+value you are trying to store is more than 1K.

Also:

    What version of perl?
    What version of MLDBM?

The code you posted runs fine for me with MLDBM 1.22 (under perl
5.003_10, unable to test under 5.003).

I'd suggest you try:

   * using DB_File or GDBM_File:
           use MLDBM qw(DB_File);
     SDBM (and NDBM) have stupid hash entry size limitations that
     you could easily overflow with MLDBM with large entries.

   * if the problem still persists, try the latest MLDBM and
     Data::Dumper on CPAN and see if that cures the problem.

In most of the bug reports I hear, the problems are with the underlying
DBM file, not with MLDBM.

Good luck.

 - Sarathy.



Mon, 24 May 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MLDBM module problem

2. MLDBM Module How do I Use?

3. untie warning when using MLDBM module

4. adressbook2.tar.gz - perl/Tk example of use MLDBM::TinyDB module improved

5. Q: Problem with MLDBM

6. Problems w/MLDBM

7. problem compiling with MLDBM

8. Problems with MLDBM-modul, databasefile growing with duplicates

9. MLDBM Problems

10. Problem with Storable and MLDBM

11. Problem installing MLDBM 2.00

12. PROBLEM: data output w/MLDBM

 

 
Powered by phpBB® Forum Software