in reply to pack_size for DBM::Deep

Is your perl compiled for 64bit? From the DBM::Deep POD:

large

This uses 8-byte offsets, allowing for a maximum file size of 16 XB (exabytes). This can only be enabled if your Perl is compiled for 64-bit.


What problem are you having?

Replies are listed 'Best First'.
Re^2: pack_size for DBM::Deep
by lordsll (Novice) on Jul 14, 2010 at 14:43 UTC
    Thanks for the quick response. Sorry not to give more information. I am running on Windows 7 using perl64. I get the following error:
    DBM::Deep: Odd number of parameters to 124 at tie_temp2.pl line 10

    My test program is as follows:

    #!/usr/bin/perl use strict; use warnings; use DBM::Deep; use Fcntl; # For O_RDWR, O_CREAT, etc. my $f1 = shift or die "usage: $0 file1 file ...\n"; open my $f, "< $f1" or die "$f1: $!\n"; tie my %f1, "DBM::Deep", "mydb.sdbm", pack_size => 'large'; while (<$f>) { $f1{$_}++; } while (<>) { # The rest of the files if (exists $f1{$_}) { print "GOOD\n"; } else { print "BAD\n"; } } untie %f1;
      The documented usage is
      tie my %f1, "DBM::Deep", { file => "mydb.sdbm", pack_size => 'large', };

      Welcome to the Monastery, please don't ignore the formatting advice given each time you post:

      Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!

      See also How do I post a question effectively?.