As giant mentioned, the most universal way to encrypt your connection would be to tunnel your traffic and let some other application/layer worry about the encryption. But, that can also become messy (especially if you don't have admin rights on the machines you are using). You also then have to worry about monitoring some other application that has to be up whenever your perl program is running.
Your only other option would be to find a database and client that supports encryption natively. For example,
PostgreSQL can be build with the --with-ssl option. However,
I found no mention of making SSL based access in DBD::PG, so it probably isn't an option.