in reply to SFTP with SSH in perl
If you are planning to use FTP over SSH with public/private keys, you need to set up the private SSH key on the source machine, then export the public SSH key and upload it to the correct location on the destination machine. This is over and above whatever Perl you code and would allow the Perl code to authenticate to the remote server. As others have said, there are modules on CPAN for this sort of thing.
If you are planning to use FTP w/SSL, then you need to get a copy of the SSL certificate for the site (there are several ways to do this, from having the site admin send it to you, to copying it out of IE or whatever browser you might be using or pointing your script to the correct local SSL cert to use. I'm not 100% fluent in the ins and outs of SSL cert authentication from a client side perspective. I've set it up and gotten it working on the server side but that's about it. The last I looked, there really wasn't anything in CPAN for handling FTP w/SSL (that could have changed) but you might look at the Net::FTP and and SSL modules that are out there for direction.
I would suggest figuring out which protocols you are planning to use (FTP over SSH aka SFTP or FTP with SSL aka FTPS) then look for modules on CPAN.