use Net::FTP 3.01; $ftp = Net::FTP->new(...) or die; $ftp->starttls or die; $ftp->login(...);