Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

  (email not shown publicly)

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Friday December 20, 2002
01:51 PM

Local databases with DBI

[ #9576 ]

DBD backends are the neatest thing since sliced bread. If I want to write a Perl program to use an SQL database, but do not have an RDBMS, there are at least five options I can think of that will use local files as an SQL database. Three of these will give you files you can use elsewhere.

  • DBD::CSV The old standby
  • DBD::Sprite readers of the first edition of O'Reilly's CGI book will recognize Sprite, originally a Perl4 style library, if I remember correctly, now made into a module, enhanced, optimized, and packaged as a DBI backend.
  • DBD::Excel Why not use an Excel workbook as a database? Each worksheet is a table. Files are completely compatible, except you will no doubt be distressed to hear that last time I tried, this module worked on UNIX but not Win32.
  • DBD::XBase dBase files, FoxPro files, Codebase, and Clipper. I once wrote a C parser for this file format. It's not bad, except each table is a separate file. I've suffered through dBase IV for five years; as of next Monday I start a new job where I intend to never touch it again.
  • DBD::SQLite Handsome little devil of a module from Matt Sergeant, the XML wizard whose unsung non-XML accomplishments in the world of Perl have benefitted me greatly. Fast, reliable, atomic, amazing.

The more tools you learn, the better a job you can do picking the right tool for the job. You might even find yourself using DBD::Excel or DBD::XBase for something that will never interact with the associated applications. Someday I may benchmark all these.

Any others I left out?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.