| 1 |
|
| 2 |
------------------------------------ |
| 3 |
XBase and DBD::XBase |
| 4 |
------------------------------------ |
| 5 |
|
| 6 |
This is the README file for the XBase and DBD::XBase packages. Please |
| 7 |
read it if you install this module for the first time or if there are |
| 8 |
some problems with the module. |
| 9 |
|
| 10 |
Module XBase provides access to XBase (dBase, Fox*) database files, |
| 11 |
namely dbf, dbt, fpt, ndx and ntx. It provides native Perl interface |
| 12 |
($table->get_record, $table->update_record) to read and write the tables. |
| 13 |
Module DBD::XBase is a DBI driver that uses the XBase module to work with |
| 14 |
the data, providing you with DBI compliant processing interface and SQL |
| 15 |
commands ($dbh->prepare("SELECT * FROM TABLE")). As an argument to |
| 16 |
DBI->connect, specify "dbi:XBase:$dir", where $dir is the directory with |
| 17 |
the data files. |
| 18 |
|
| 19 |
So this package offers two ways of accessing your beloved data in dbf |
| 20 |
files: XBase and DBD::XBase. You are free to pick any you find more |
| 21 |
suitable for your project, I personally prefer the DBD::XBase. |
| 22 |
|
| 23 |
No other servers/software are needed, these modules directly read and |
| 24 |
write the files. The main goal was to create a parser, mainly to work |
| 25 |
with data from your legacy applications. If you are looking for something |
| 26 |
more powerfull, check real relation database servers, such as MySQL or |
| 27 |
PostgreSQL. |
| 28 |
|
| 29 |
The distribution also includes a dbfdump script that prints the content |
| 30 |
of the table in readable form. |
| 31 |
|
| 32 |
The support for ndx/ntx index files is rather minimal. It currently |
| 33 |
allows you to search directly to the record you want, in the XBase |
| 34 |
module. But you cannot create the index, nor is the index updated when |
| 35 |
you change the dbf. Check the eg/ directory for how you can help to |
| 36 |
make it better. |
| 37 |
|
| 38 |
You have to have Perl version 5.004. [Please do not ask me to make these |
| 39 |
modules work under 5.003 or older version -- upgrade instead.] |
| 40 |
|
| 41 |
You need a DBI module version at least 1.0 to use the DBD driver. If you |
| 42 |
have older DBI and cannot upgrade for some reason, check the CPAN for |
| 43 |
DBD::XBase version < 0.090. Those are the last versions that do not |
| 44 |
require DBI 1.0. [Please do not ask me to make this line of DBD::XBase |
| 45 |
work under older DBI's -- it will not work. Please do not ask me to make |
| 46 |
the DBD::XBase work without DBI -- it will not work. Use the XBase |
| 47 |
interface or install the DBI module. (This may seem rude but I only |
| 48 |
try to avoid missunderstanding and unhappiness -- on both sides ;-)] |
| 49 |
|
| 50 |
This module is provided in a hope you might find it usefull. My intent |
| 51 |
is to support as many variations of formats as possible, but I do not |
| 52 |
have dBase/Fox* and do not plan to have, so send me examples of your |
| 53 |
data files if you feel your native XBase engines produce data |
| 54 |
incompatible with this module. |
| 55 |
|
| 56 |
Man pages for XBase, DBD::XBase and dbfdump are included, examples of |
| 57 |
little scripts can also be found in eg/ directory of the distribution. |
| 58 |
Read the DBI man page for DBI specific issues. |
| 59 |
|
| 60 |
Installation: |
| 61 |
Download the tar.gz, unpack it, change to the DBD-XBase-* |
| 62 |
directory. Then do |
| 63 |
|
| 64 |
perl Makefile.PL |
| 65 |
make |
| 66 |
make test |
| 67 |
make install |
| 68 |
|
| 69 |
or you can use CPAN module and do |
| 70 |
|
| 71 |
perl -MCPAN -e shell |
| 72 |
cpan> install DBD::XBase |
| 73 |
|
| 74 |
You have to have Perl version 5.004. You need a DBI module version |
| 75 |
1.0 or higher to use the DBD driver. |
| 76 |
|
| 77 |
Some people asked whether it is possible to use the module |
| 78 |
even if they do not have root access. Even if this is in |
| 79 |
sufficient detail covered in the docs that come with Perl, |
| 80 |
here's the process: |
| 81 |
|
| 82 |
You install the module |
| 83 |
|
| 84 |
perl Makefile.PL LIB=/your/directory \ |
| 85 |
INSTALLMAN1DIR=/path/for/man1 \ |
| 86 |
INSTALLMAN3DIR=/path/for/man3 |
| 87 |
|
| 88 |
instead of just perl Makefile.PL, and in your scripts do |
| 89 |
|
| 90 |
use lib '/your/directory'; |
| 91 |
use XBase; |
| 92 |
|
| 93 |
Some people asked how to use this module when they are not |
| 94 |
able to run make on their system. Even if it's beyond my |
| 95 |
understanding why somebody would want to use such system, you |
| 96 |
are free to just copy the lib/ directory where you want it to |
| 97 |
have. This should work. (BTW: some systems have make renamed |
| 98 |
and do not take the time to make a symlink. Ask your system |
| 99 |
administrator.) |
| 100 |
|
| 101 |
Problems and bug reports: |
| 102 |
If anything goes wrong when installing/make test, please send |
| 103 |
me output of your installation messages and of |
| 104 |
|
| 105 |
make test TEST_VERBOSE=1 |
| 106 |
|
| 107 |
Each version of the module is tested on IRIX, Linux and |
| 108 |
Solaris before releasing but surely there might be situation |
| 109 |
where something is corrupted on other platforms. If you send |
| 110 |
me reasonable output, these errors are typically fixed in |
| 111 |
a matter of hours (unless I'm gone for a vacation). |
| 112 |
|
| 113 |
If there are errors when actually using the module on your |
| 114 |
data, please check first that it's really a XBase/DBD::XBase |
| 115 |
problem. If so, please send me example of your script, the |
| 116 |
errstr messages you get and (if possible) your data files that |
| 117 |
cause the problems, so that I can trace down the problem. Add |
| 118 |
info about your OS, version of Perl and other modules that |
| 119 |
might be relevant. You can of course also send patches to |
| 120 |
actual bugs. |
| 121 |
|
| 122 |
Mention the word "XBase" in the Subject line, otherwise your |
| 123 |
post will probably just slip through my 1 MB daily email load |
| 124 |
without even being read. Please note that I'm _very_ busy, so |
| 125 |
try to help me to help you by using the latest version of the |
| 126 |
module, minimalizing the script code that causes you problems, |
| 127 |
providing me with tiny sample of datafile, anything that might |
| 128 |
be related. Detailed description and small examples are the |
| 129 |
best. |
| 130 |
|
| 131 |
For general Perl issues, use the comp.lang.perl.m* newsgroups, |
| 132 |
for DBI issues, use [email protected]. |
| 133 |
|
| 134 |
If it works for you: |
| 135 |
I'd appreciate any message if you use the module and find it |
| 136 |
usefull -- I'm just curious what tasks people use the module |
| 137 |
for and what they expect from it. You can of course also |
| 138 |
send something more valuable. |
| 139 |
|
| 140 |
Available: |
| 141 |
http://www.fi.muni.cz/~adelton/perl/ and from your favorite |
| 142 |
CPAN site in the authors/id/JANPAZ/ directory. |
| 143 |
|
| 144 |
Copyright: (c) 1997--1999 Jan Pazdziora, [email protected]. All rights |
| 145 |
reserved. This package is free software; you can redistribute |
| 146 |
it and/or modify it under the same terms as Perl itself. |
| 147 |
|