[Dub-pm] DBM behaviour

Fergal Daly fergald at gmail.com
Thu Apr 28 02:45:51 PDT 2005


Are you using dbmopen? If so then you you are probably using the
default dbm system which tends not to be Berkeley. In your case it's
NDBM or something else which stores the database in 2 files. From the
bottom of the dbmopen part of the perlfunc manpage

               See also AnyDBM_File for a more general description of the
               pros and cons of the various dbm approaches, as well as
               DB_File for a particularly rich implementation.

               You can control which DBM library you use by loading that
               library before you call dbmopen():

                   use DB_File;
                   dbmopen(%NS_Hist, "$ENV{HOME}/.netscape/history.db")
                       or die "Can<E2><80><99>t open netscape history file: $!";

so a "use DB_File;" will probably fix your problem (or you could
recompile perl to use Berkelely DB as it's default)

F

On 4/28/05, Andrew Barnes <abarnes+dublin-pm at mosina.com.au> wrote:
> Hiyas,
> 
> I've got a question about DBM behaviour on Debian Stable (pinned to testing)
> 
> perl, v5.8.4 built for i386-linux-thread-multi
> 
> I'm using (read borrowing, with permission ;>) a script that expects DMB
> files with a .db extensions when reading in existing files, however when I
> create files, I get two files - with .dir and .pag extensions
> 
> Is there any way to modify this behaviour?  Or do I need to go modifying
> the script to take into account the new behaviour?
> 
> Andrew
> 
> --
> Andrew Barnes
> Dublin Perl Mongers
> W:    http://dublin.pm.org
> M:    andrewbarnes at ramsesit.com
> SIP:  3073 at blueface.ie
> M:    +353 86 3803633
> PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26
> 
> _______________________________________________
> Dublin-pm mailing list - Dublin-pm at pm.org
> http://dublin.pm.org/ - IRC irc.linux.ie #dublin-pm
>


More information about the Dublin-pm mailing list