in reply to Downloading file

Everything will depend on the machine you are running this script on. UNIX/LINUX, Windows and Mac all have different ideas on what is a text file and esp. how to end each line. Hence you should use binmode both on reading and writing your file in order to avoid the line-endings being "transformed".

Still if your source file resides on a UNIX system and the client downloads it to a Windows machine, chances are that he will still have problems in reading the file as it will have UNIX-style line-endings. Sadly, there is nothing you can do about that as you do not control the world outside your server!

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law