Mark Knoop wrote:

> Hi
> 
> Not sure if this falls within the remit of good question etiquette but on
> the off chance that someone can help me out here goes...
> 
> I have downloaded some code in order to run a proof of concept for an
> application that obtains information for a given user-agent of a mobile
> device.
> 
> This application uses MLDBM.pm and is giving me the following error:
> 
> sdbm store returned -1, errno 22, key "versions" at
> C:/Perl/site/lib/MLDBM.pm line 161, <IN> line 47800.
> 
> My problem is that I am unfamiliar with MLDBM.pm and I am having
> difficulties understanding how MLDBM.pm actually works and so working out
> how to deal with this error.
> 
> To summarize there is a demo script ua.pl which uses a module WURFLite.pm to
> look up a user agent from wurfl.xml.

Create a small complete snippet that reproduces your problem so we have an
easy way to reproduce it.

> These are available at http://webcab.de/WURFL/ and
> http://wurfl.sourceforge.net/ - I have not included them here due to the
> size and the fact that my question at this stage is not aiming to be too
> specific. I can post them if anyone thinks they may help.
> 
> 47800 is the last line in the version of the xml that I am using.
> 
> It worked fine on a linux box but will not work with AS Perl on a windows
> box.
> 
> Basically what I am asking is if anyone has used MLDBM.pm in AS Perl on a
> windows box and has come across something like this, or if someone can help
> me with my understanding of what MLDBM does or how it works so that I might
> understand what the error msg means.
> 
> I know there is also a Mobile::WURFL module but that uses a database which I
> would like to avoid if possible.
> 
> Any pointers much appreciated.

Personally I wouldn't use SDBM for all but the simplest of DBs.
Long keys like 50 chars will fail after like 138 entries due to
low compiled in limits.

I would switch to DB_File to utilize the Berkeley DB v1 - you may not even
need MLDBM depending on your usage.

>From MLDBM pod you can see how to us DB_File :

MLDBM - store multi-level hash structure in single level tied hash

=head1 SYNOPSIS

    use MLDBM;                          # this gets the default, SDBM
    #use MLDBM qw(DB_File FreezeThaw);  # use FreezeThaw for serializing
    #use MLDBM qw(DB_File Storable);    # use Storable for serializing

    $dbm = tie %o, 'MLDBM' [..other DBM args..] or die $!;


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to