Perl DBM problem...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Kinda CentOS related so bear with me. :)

We have little legacy perl app on an old RH 7.3 box I'm trying to
migrate over to a CentOS 4 system. Some information the app uses is in
Berkley DB format

[root@korma data]# file *.db
applic.db:    Berkeley DB (Hash, version 5, native byte-order)
cables.db:    Berkeley DB (Hash, version 5, native byte-order)
connector.db: Berkeley DB (Hash, version 5, native byte-order)
equipment.db: Berkeley DB (Hash, version 5, native byte-order)
hood.db:      Berkeley DB (Hash, version 5, native byte-order)
interface.db: Berkeley DB (Hash, version 5, native byte-order)
wire.db:      Berkeley DB (Hash, version 5, native byte-order)

If I run the following Perl test script ...

#!/usr/bin/perl
#
#

if ($ARGV[0] eq "") {
  print "\n  * *  give me a DBM file name to dump (no DBM extension)  * *\n";
  exit;
}
dbmopen (%dumpfile, $ARGV[0], 0400) || die "Can't open DB file!" ;
foreach $line (sort keys %dumpfile) {
  print <<END1;
  $line  -  $dumpfile{$line}
END1
}
dbmclose (%dumpfile);

Running that against any of the BDB files on the old RH 7.3 system
dumps the file's data successfully.

Copy everything over to the CentOS system

[root@willspc data]# file *.db
applic.db:    Berkeley DB (Hash, version 5, native byte-order)
cables.db:    Berkeley DB (Hash, version 5, native byte-order)
connector.db: Berkeley DB (Hash, version 5, native byte-order)
equipment.db: Berkeley DB (Hash, version 5, native byte-order)
hood.db:      Berkeley DB (Hash, version 5, native byte-order)
interface.db: Berkeley DB (Hash, version 5, native byte-order)
wire.db:      Berkeley DB (Hash, version 5, native byte-order)

Run the script again, e.g...

[root@willspc data]# ./dump.pl cables
[root@willspc data]# file cables*
cables:    Berkeley DB (Hash, version 7, native byte-order)
cables.db: Berkeley DB (Hash, version 5, native byte-order)

And it dumps a new BDB with version 7, no other output. Stracing the
process shows it's using DB_File.pm

I'm a bit stumped as to what to try next.

Will.

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux