Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!olivea!uunet!uunet!rbj From: rbj@uunet.uu.net (Root Boy Jim) Newsgroups: comp.lang.perl Subject: Re: perl 4.0 with dbz and news history files Message-ID: <1991Jun19.232347.13491@uunet.uu.net> Date: 19 Jun 91 23:23:47 GMT References: <2156@mitisft.Convergent.COM> Organization: UUNET Communications Services, Falls Church, VA Lines: 37 bms@mitisft.Convergent.COM (Bruce Schlobohm) writes: ?I recently switched over to running Bnews 2.11.19 with dbm history file, ?(from the non-dbm method). I chose to use the dbz library instead of ?dbm for it's space savings. However, soon thereafter I had the need ?to write a perl script which would parse a list of messageids, and look ?up the files in the spool directory. I started with Tom Christiansen's ?xpost program, but couldn't get it to work... kept getting "no article". Watch out for duplicate articles! ?I recompiled the news programs with the real dbm (consequently now have ?a large history.pag file), and xpost works just fine. I was then able ?to get my perl script to work and all is well. What do you call large? Our history file itself is 15 Megs. The .pag (dbz) file is only 1.7 Meg. However, the old dbm was 45 Megs! ?I like the smallness of the dbz files however. Don't we all! ?Is there a way that I can use perl (compiled with ndbm) on dbz files, ?and still use the dbmopen() and associative array? No. The format is different. What you want is a separate process that looks up entries for you. In fact, the dbz program itself has just the option (-x, possibly with -i) you want. ?What am I missing? One thing is that the "data" that is returned is actually a four byte lseek pointer into the flat file. You have to look it up yourself. -- [rbj@uunet 1] stty sane unknown mode: sane