SA Bugzilla – Bug 1681
sa-learn AnyDBM_File doesn't define an EXISTS method in BayesStore.pm line 658
Last modified: 2003-03-31 09:13:45 UTC
I recently installed spamassassin 2.51 and as soon as we tried to do sa-learn we got the following problem: $ sa-learn --nonspam --dir ~/Mail/inbox AnyDBM_File doesn't define an EXISTS method at /cpd/gnu/modules/perl5.6.1/lib/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 658 This is the first global installation we've used. According to my user's, this did not happen with versino 2.50 when installed in their home directories. Let me know if you need any further information.
Ok, I had a local perl hacker look at this, and we found out what is going on. the interface from perl to ndbm (NDBM_File) does not support the EXISTS method to check whether a key exists in the database. In the file BayesStore.pm, if you change the line: BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File SDBM_File); } to BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File SDBM_File); } this fixes the problem. Probably other people (like the SpamAssassin developers) aren't having this problem because they are running on machines that have either Berkeley DB ("DB_File") or gdbm installed. I think gdbm is standard on linux. By removing NDBM_File from the list the SDBM database library that comes with perl is used instead.
Subject: Re: [SAdev] sa-learn AnyDBM_File doesn't define an EXISTS method in BayesStore.pm line 658 > By removing NDBM_File from the list the SDBM database library that comes > with perl is used instead. BTW, I strongly recommend installing DB_File if possible, it's much faster and more efficient.
I can confirm this problem on Tru64 (formerly DEC OSF/1 with perl 5.6.1 and SA 2.52).
*** Bug 1709 has been marked as a duplicate of this bug. ***
Created attachment 849 [details] change back to using defined(). I could not observe any speed hit from this change, so it seems safe
OKAY
OKAY: I'd rather leave it as exists and kill the stupid NDBM, but for now it's ok by me.
ok, now in 2.53.