I have had the same problem, caused by the different line endings for Windows and Linux. Running dos2unix or any similar utility against your script should work. BTW, uploading as ASCII should have avoided this problem.
Update: I use UltraEdit when I have to edit perl code on Windows, but it's not free software =(.