tags:

views:

203

answers:

3

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.

+1  A: 

You have two alternatves: fix MARC::Charset so it doesn't need GDBM_File, or build your own Perl.

Honestly, building your own Perl is probably faster and safer. If you've never installed Perl before, I recommend you use MacPorts (http://macports.org), which will install it in /opt/local/bin/perl. You can then use "/opt/local/bin/cpan MARC::Charset" to install the module you need.

MacPorts doesn't by default build a threaded Perl - I know there's woojy-woojy on the install to do that, but I'm allergic to threads from my initial exposure to them and have never bothered to figure out what it is.

Joe McMahon
Unfortunately, requiring my customer to build and install a full distribution of Perl is not an option.Additionally, it seems that wouldn't even be enough as gdbm is not installed on MacOS X.
Jean-Denis Muys
+4  A: 

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.

/I3az/

draegtun
A: 

I eventually solved the problem by using the previous version of MARC::Charset. The previous version did not use GDBM_File but another facility. That was the only change between the versions, and the reason for the change was not stated.

Using the previous version fixed everything.

Jean-Denis Muys
I am glad you resolved the issue but don't you think your answer above would be better served as a comment under my answer? :(
draegtun
Yep you are right. I bumped your answer and tagged it as correct.
Jean-Denis Muys
Many thanks Jean-Denis.
draegtun