in reply to Strange math issue with Net::SFTP

You should consider using Net::SFTP::Foreign instead of Net::SFTP.