If you are connecting to a remote server across the public internet, then you might want to consider the security issues - especially if the data you are dealing with is sensitive/confidential in nature.
One way to reduce the risk is to establish a connection across an ssh tunnel. At my workplace we use a homegrown library for this purpose which makes use of
IPC::Open2. (The code for this is quite old - about 4-5 years - but it works, so we continue to use it). There are quite possibly newer modules available these days that take care of this task, so it's probably worth your while having a fossick about on
CPAN.
Cheers,
--Darren