in reply to Strange GDBM behavior
(According to perldoc -f dbmopen -- at least in my 5.8.1 version -- you can say "use SOMEDBM_File;" in combination with dbmopen, in order to override whatever dbm library was designated as the default when your perl was installed.)
But if the default dbm library works for you, all you need to do is find out what that is and check that it's available in all the places where you want your code to be portable to. Here's a one-liner to find out the default:
perl -MAnyDBM_File -e 'print $AnyDBM_File::ISA[0],$/'
I get "NDBM_File" on macosx/perl-5.8.1, freebsd/perl-5.8.6 and solaris/perl-5.8.0 -- and since NDBM, like GDBM, is not byte-order dependent, it seems like a safe choice (unless the 4K limit on record size is an issue for you, which it probably isn't).
(minor update to fix grammar; also noticed that NDBM was also the default on 5.005_03 perl on solaris)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Strange GDBM behavior
by wink (Scribe) on Jul 22, 2005 at 05:14 UTC |