http://www.perlmonks.org?node_id=999453


in reply to GDBM_File for Windows?

how do I get GDBM_File working on ActiveState/Windows, for Perl 5.10?

Yuck ... with Strawberry Perl, GDBM_File is built in as perl itself is being built.
I don't know what would be involved in building GDBM_File *after* perl has been built (should it even be possible).

If your perl version is 5.10.0, grab http://strawberryperl.com/download/5.10.0/strawberry-perl-5.10.0.6.zip, for 5.10.1 grab http://strawberryperl.com/download/5.10.1.2/strawberry-perl-5.10.1.2.zip.

Unzip the file to some location and see if GDBM_File was included with Strawberry Perl back then. If it was, then access that location via your PERL5LIB environment variable.

Then, let us know whether that worked. If it didn't work, tell us the error you got - it may still be fixable, depending of course upon what the problem is.
It seems to work ok for me with 5.16.0 - so I'm hopeful it will work for you.
If it *does* work, we'll need to modify PERL5LIB so that your @INC gets searched before the Strawberry folders ... and we can also remove most of the Strawberry files that you've unpacked.

If you need more help (eg if you don't know how to utilize the PERL5LIB environment variable), could you provide the output of perl -V (that's uppercase V), and also tell us what, if anything, PERL5LIB was originally set to. That will help us to help you.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: GDBM_File for Windows?
by MikeRaffety (Initiate) on Oct 17, 2012 at 15:43 UTC
    OK, so I got GDBM_File working, sort of, using MinGW. Now the problem is ... GDBM_File works fine with a NEW data file, but it errors out trying to access the old data file: couldn't open DBM: Bad file descriptor at E:\Data\webroot\cgi-bin\BUdepend\Delete.pl line 9. Note that I'm running this simple little test script from the command line (ultimately the whole thing does run as a CGI). Line 9 is just the tie() call: tie(%bu, 'GDBM_File', 'BUdepend.dat' , &GDBM_WRCREAT, 0666) or die "couldn't open DBM: $!"; I'm pretty sure the DBM file is not corrupted, it's a clean copy from a backup from the old system. I'm pretty sure there's no permissions problem, as "-w" and "open '<'" work just fine, and the permissions look OK when I check them. The one thing I don't know is what version of GDBM was used on the old system, but it was only two years old, and surely any changes wouldn't have backwards compatibility issues for data files?