Perl on MacOS X 10.6.2: missing GDBM_File, how to install or work around?

When I need a Perl module, I usually use CPAN. It is working fine. But not at this time.

I want to use MARC :: Charset, but this one uses GDBM_File, and I cannot set GDBM_File from CPAN.

CPAN finds everything in order, but trying to install it, he starts installing the full Perl 5.10.1 distribution.

MARC :: Charset is a fairly old module, so there should be a way to use it from some general version of Perl (Mac OS X 10.6.2 has 5.10.0 and 5.8.9 by default).

When setting full hit Perl 5.10.1 is not an option, changing MARC :: Charset to stop using GDBM_File can be one. What would be the best course of action?

This last option may also be the only one. googling GDBM_File reveals several elements that suggest that gdbm is not even available on Mac. These items usually went over my head.

Until I expect a silver bullet, someone might have a pointer or two where I should start.

After all, MARC :: Charset only does transliteration of characters to / from the marc8 char set, unfortunately iconv doesn't seem to support it.

+4
source share
3 answers

GDBM_File is the main module of Perl . This is why it tries to upgrade your Perl to the latest version when installing this module.

It seems that Mac OS X does not ship with GDBM and therefore has not built and included the necessary modules with any of its development languages. This is probably quite a long time .

So your first hurdle is installing / compiling GDBM. MacPorts provides the package .

GDBM_File is an XS module, so you have to compile it. Perl 5.10.0 GDBM_File code can be found here .

BTW: MARC::Charset only switched to GDBM_File in version 1.1 (latest version). The previous version 1.0 is used by SDBM_File which comes with Perl on Mac OS X (although I have not personally tested its operation).

So you can find the previous version of MARC :: Charset is the best option to try.

+6
source

You have two options: fix MARC :: Charset so that it does not need GDBM_File or create its own Perl.

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

MacPorts does not by default create streaming Perl - I know that woojy-woojy is on the installation to do this, but I am allergic to streams from my initial exposure to them and never worried about what it is.

+1
source

I eventually solved the problem using the previous version of MARC :: Charset. In the previous version, GDBM_File was not used, but was different. This was the only change between versions, and the reason for the change was not indicated.

Using the previous version, everything is fixed.

0
source

Source: https://habr.com/ru/post/1299634/


All Articles