Just using sockets doesn't give you any security at all. The right choice depends on the application, the systems you're using, and how much the users understand about what they need to do to use it. For example, if you're interacting with a web server in a secure way, you'll probably end up using TLS/SSL for it. If you're just transferring data between two systems, using ssh might well be the most convenient way.
When you say "security", are you looking for encrypted data on the network? Authentication of the communicating parties? Both?
Another alternative is using TLS/SSL, probably with the OpenSSL toolkit (and there are Perl modules with bindings for it.) The programming is more complicated than with ssh, and you'll have to do more work on authentication for it, so it comes back to whatever it is you're trying to do.
Also, FTP isn't secure on its own either.