Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Perl Monk, Perl Meditation
 
PerlMonks  

GDBM_File for Windows?

by MikeRaffety (Initiate)
on Oct 16, 2012 at 16:37 UTC ( #999372=perlquestion: print w/ replies, xml ) Need Help??
MikeRaffety has asked for the wisdom of the Perl Monks concerning the following question:

First time poster, long-time reader.

This is what SHOULD be a simple quest -- how do I get GDBM_File working on ActiveState/Windows, for Perl 5.10?

I've Googled and Googled (and I'm usually quite good with Google), and I find a LOT of people having the same problem, but with no solutions! Part of it is bundled with Perl, yes, and I've downloaded and installed the libgdbm.a package.

I know it can work, it worked on an old PC, then that PC crashed, and I'm faced with getting a Perl script working again on the new box.

Please help!

Comment on GDBM_File for Windows?
Re: GDBM_File for Windows?
by Anonymous Monk on Oct 16, 2012 at 16:46 UTC
      Why? Because this software, already written, relies on it and is proven to work with it. I'd rather not rewrite and test it to use a different DBM package.
Re: GDBM_File for Windows?
by daxim (Chaplain) on Oct 16, 2012 at 16:53 UTC
      As best as I can tell, this Strawberry file requires compiling; I have no compiler on this Windows machine, no development environment. Usually Perl packages for Windows that require native code provide that pre-compiled. Also, there's no libgdbm included and no explanation of how to integrate that (I've installed that already separately).

        Strawberry Perl (and I think ActivePerl now also) includes a development environment that should work with the CPAN interface or manually at the command line.

        What version of Windows are you installing to? Did you install gdbm for Windows? (not GDBM_File)

Re: GDBM_File for Windows?
by syphilis (Canon) on Oct 17, 2012 at 04:43 UTC
    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
      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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://999372]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-04-20 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (487 votes), past polls