Perl on MacOS X 10.6.2: GDBM_File missing, how to install or work around?
cpan, macos, perl
Solution
`GDBM_File` is a core Perl module. This is why its trying to upgrade your Perl to latest version when you install this module.
It seems Mac OS X doesn't come with GDBM and therefore haven't built and included the necessary modules with any of its provided development languages. And this seems to have been the case for quite some time.
So your first obstacle is the install/compile GDBM. MacPorts does provide a package.
`GDBM_File` is a XS module so you will have to compile it. The Perl 5.10.0 `GDBM_File code` can be found here.
BTW: `MARC::Charset` only switched to `GDBM_File` at version 1.1 (latest version). The previous version 1.0 used `SDBM_File` which does come with Perl on Mac OS X (though haven't personally tested it works).
So you may find downloading previous version of MARC::Charset a better option to try.
Problem
When I need a Perl module, I typically use CPAN. It works fine. But not this time. I want to use MARC::Charset, but this one uses GDBM_File, and I can't seem to install GDBM_File from CPAN. CPAN finds it all right, but trying to install it, it starts installing the full Perl 5.10.1 distribution. MARC::Charset is a rather old module, so there should be a way to use it from some common Perl version (Mac OS X 10.6.2 has 5.10.0 and 5.8.9 by default). While installing the full blow Perl 5.10.1 is not an option, modifying MARC::Charset to stop using GDBM_File might be one. What would be the best course of action to do so? This last option might also be the only one. googling GDBM_File uncovers a few items that suggest that gdbm is not even available on the Mac. Those items typically went over my head though. While I don't expect a silver bullet, somebody may have a pointer or two on where I should start. After all, MARC::Charset only does character transliteration to/from the marc8 char set, which unfortunately, iconv doesn't seem to support.