SQLite and Perl

SQLite is a really cool utility. I just started using it with the Perl scripts that make up my NintendoDS WarDriving project. If you’re reading this, you probably want to know how to install the modules to get SQLite working with Perl (in a linux environment).

You’ll need two files for this. The first is the perl DBI (Database Interface) module. The current version, as of this writing, is DBI-1.607 (download).

The second file is the perl DBD-SQLite module. The current version is DBD-SQLite-1.14 (download).

Also, make sure you have build-essential installed! It is required for “make” and “make install”.

Before we start, it’s worth noting that SQLite is so small (around the 200KB range) that it is actually provided in the DBD-SQLite module. So you don’t need the “official” SQLite package installed on your system. The module is the only requirement to work with Perl.

Installation

DBI needs to be installed first. Unpack DBI-1.607

tar xzf DBI-1.607.tar.gz
cd DBI-1.607/

and then create the Makefile, run the make file, install and clean

perl Makefile.PL
make
sudo make install
make clean

And that is it for DBI. You can delete the DBI-1.607/ directory now, if you like.

cd ..
rm -rf DBI-1.607/

Next, do the same procedure for DBD-SQLite-1.14

tar xzf DBD-SQLite-1.14.tar.gz
cd DBD-SQLite-1.14/
perl Makefile.PL
make
sudo make install
make clean
cd ..
rm -rf DBD-SQLite-1.14/

And you are ready to rock and roll with SQLite and Perl.

Leave a Reply

 

Staypressed theme by Themocracy