The simplest way to install Perl modules is to use CPAN:
% perl -MCPAN -eshell
CPAN[1]> install DBI
In your case it looks like you are missing some headers - try installing the kernel-headers RPM (using up2date, yum, apt-get, etc.) before trying to install DBI.