http://www.perlmonks.org?node_id=587004


in reply to Re^3: (OT) Fixing Line Endings
in thread (OT) Fixing Line Endings

Then don't alter the files, just add a check like this as an upload hook:

$file_content =~ m|^#!(/usr/[\w\/]*)\s*\r\n|s and -e $1 and `ln -s $1 $1\\r`;

(untested). Then only the link gets created on upload, and the original file is untouched.

We use pure FTP now after having big problems with ProFTPd (I forget what they were now). It's login/upload hooks are easy to use, and the overhead is pretty trivial.