The CPAN offers the source for hundreds of modules and scripts, including DBI and DBD::DB2, along with a standard method for building and installing those modules.
From the command line, you can invoke the CPAN module to automatically download, build, and install CPAN modules. Note: the printed instructions contain a mistake, DB2_HOME needs to point to the /sqllib/ directory of the client.
Installing DBI & DBD::DB2 on Linux
bash# export DB2_HOME=/home/db2inst1/sqllib/ bash# perl -MCPAN -e 'install DBI' bash# perl -MCPAN -e 'install DBD-DB2'
On Windows, the ActiveState Perl distribution offers the Perl Package Manager (PPM) for downloading and installing binary modules. ftp://ftp.esoftmatic.com/outgoing/DBI/ generously builds and hosts the Windows binary modules for DBI and a number of database drivers, including DBD::DB2.
Installing DBI & DBD::DB2 on Windows
C:\> ppm install http://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd C:\> ppm install http://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-DB2.ppd
Note: ActiveState Perl 5.8.7 will work with DBI and DBD::DB2 modules that have been compiled with previous versions of ActiveState Perl.