[vox-tech] perl db question

Henry House vox-tech@lists.lugod.org
Wed, 6 Mar 2002 16:34:15 -0800


--3V7upXqbjpZ4EhLz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 06, 2002 at 10:33:27AM -0800, Peter Jay Salzman wrote:
> i've never used a real database in my life.   first attempt:
>=20
> Can't locate object method "TIEHASH" via package "/home/p/.car/blah" at
> ./newmain.pl line 97, <> line 7 (#1)
> (F) You said to do (or require, or use) a file that couldn't be
> found. Perl looks for the file in all the locations mentioned in @INC,
> unless the file name included the full path to the file.
>=20
> use DB_File;
> ...
> tie %vehicle, $control, 'data', O_RDWR|O_CREAT|O_EXCL, 0644;
>=20
> help?   if someone can send me a "hello world" type program that uses
> BSD-DB, that would be really useful.

There is one in the manual page that provides a decent example. There are
more in O'Reilly's "Programming the Perl DBI". EXample scripts from the book
may be found on O'Reilly's FTP site.

> btw, i looked for henry's notes from his lugod talk on perl db; they
> don't seem to be on the website.  :(

It may be found at <http://hajhouse.org/linux/dbi.dvi>. But my talk discuss=
es
the Perl DBI (for Postgresql and other server-based SQL-interpreting
databases), while you appear to be using the Berkeley DB, which, alas, I ha=
ve
not. If you are not set on Berkeley DB and can settle for slower performanc=
e,
you might consider DBD::CSV (Debian: libdbd-csv-perl), which emulates an SQL
database in a human-readable flat file.

--=20
Henry House
The attached file is a digital signature. See <http://romana.hajhouse.org/p=
gp>
for information.  My OpenPGP key: <http://romana.hajhouse.org/hajhouse.asc>.

--3V7upXqbjpZ4EhLz
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8hrWHKK1cAVjXujwRAgmLAKC6GvaVO8iGstSMHata3OEdhbaaOQCg5Sug
S5i5CC3yH+JCCkBLpNteKaY=
=FlKp
-----END PGP SIGNATURE-----

--3V7upXqbjpZ4EhLz--