Wiggins has asked for the wisdom of the Perl Monks concerning the following question:

This is a puzzlement of the environment, not Perl syntax. I have done nothing creative. Simply run a piece of sample code. The following is a sample program from perldoc:
#--http://perldoc.perl.org/functions/tie.html # print out history file offsets use NDBM_File; tie(%HIST, 'NDBM_File', '/usr/lib/news/history', 1, 0); while (($key,$val) = each %HIST) { print $key, ' = ', unpack('L',$val), "\n"; } untie(%HIST)
Which, on fedora 9
Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.18-92.1.10.el5, archname=i386-linux-thread-multi uname='linux x86-6.fedora.phx.redhat.com 2.6.18-92.1.10.el5 #1 smp wed jul 23 03:56:11 edt 2008 i686 i686 i386 gnulinux '
produces:
[Perl]# perl testTie1.pl Can't locate NDBM_File.pm in @INC (@INC contains: /usr/lib/perl5/5.10. +0/i386-lin ux-thread-multi /usr/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5 +.10.0/i386 -linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/per +l5/vendor_ perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 +/usr/lib/p erl5/vendor_perl /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thre +ad-multi / usr/local/lib/perl5/site_perl/5.10.0 /usr/local/lib/perl5/site_perl /u +sr/lib/per l5/site_perl .) at testTie1.pl line 2.
My search produced bupkis:
[prompt]# find / -name "NDBM_File*" [prompt]# perl -V
So bring in CPANplus, to install NDBM_File:
CPAN Terminal> m NDBM_File 1 Memoize::NDBM_File 0.65 MJD 2 NDBM_File 1.07 NWCLARK CPAN Terminal> install 2 Installing NDBM_File (1.07) [ERROR] The core Perl 5.010000 module 'NDBM_File' can only be upgraded + from 0 to 1.07 by Perl itself (perl-5.8.9.tar.gz). Aborting install. *** Install log written to: /root/.cpanplus/install-logs/NDBM_File-1.07-1239814025.log
HUH!! ?? (perl-5.8.9.tar.gz)

It is always better to have seen your target for yourself, rather than depend upon someone else's description.

Replies are listed 'Best First'.
Re: NDBM_File on 5.8 only??
by Anonymous Monk on Apr 16, 2009 at 04:21 UTC