What Dave said with two clarifications.
- text mode is more commonly referred to as ASCII mode, eg, in the Net::FTP documentation
- ASCII mode is the default, so if you remove the line $ftp->binary(); from your code you'll solve your described problem
Be Appropriate && Follow Your Curiosity