I agree. Unless you can use a mostly database independent layer like Class::DBI (and that depends mostly on the kind of queries you need to do), IMO the best you can do is to at least make it easy to switch databases later. You usually don't need
, you just don't want to make it too hard to switch. Factoring out the SQL from the application code is probably a good idea. For instance, you can probably go a long way just by putting the SQL statements in a seperate file.