For what s/\s+$// does, see perlop and perlre, and compare that with chomp.
In reply to Re^5: Net::FTP usage by Corion in thread Net::FTP usage by kafkaf55