I think this is ultimately more an issue of packaging vs. a simple shell script as you've written here.  I'd be happy to take a system that will create a proper .deb file for ubunutu (or .rpm for rpm based systems) but what you've got below has issues on two fronts:

1) Installing things from CPAN that are likely in your distro is a *BAD* idea, and I can almost guarantee that Debian and Ubuntu have DBD::SQLite at the very least

2) This doesn't solve the greater distribution problem, which is better solved by creating the pieces needed to make proper packages for the various distributions