in reply to chmod of an FTP transfer via perl

You need to use the FTP SITE method for this. FTP is an old, old protocol (one of the first--the original RFCs date back to the early '70s) and it has no inherent support for, amongst other things, file permissions. So to set the permissions you need to execute a command on the remote server, via SITE, to do this.

You may find you can't, as the site interface is often either restricted or completely locked down, but if you're lucky it'll be there. Unfortunately because the site interface is being used you can't count on any sort of consistency across servers, but if you're using wu-ftpd or something compatible, the command looks like:

$ftp->site("CHMOD $mode $file");
If you're not lucky, well, check your server docs and hope for the best.