Click to See Complete Forum and Search --> : scripts squashed up


domuk
01-31-2004, 02:12 PM
Hi it's me again,

Could someone please tell me why when I download scripts from perl scripting sites they come all “squashed up” with squares where there should be carriage returns. This makes it very difficult to read.

I think it is something to do with notepad and the file saving / viewing.

I appear to be able to get cgi and perl scripts working when I can cut and paste from an online text file and thus keep the correct “un squashed format”.

1) If I use them in the squashed format (with squares) will they work?

2) If I cut and paste into WordPad it appears to un squash them. Should I be using WordPad for cgi scripts?

3) Why does this happen?

4) Is it something to do with my FTP software (smartFTP)?

5) Could this explain why I cannot get any downloaded perl scripts working and I keep getting “internal server error 500”?

6) If I manually remove the squares and resave them in notepad (yes I have tried that in desperation) will this not work?

7) what format should I be saving / downloading / viewing *.pl and *.cgi scripts in?

Your help is always appreciated for this novice…

Thanks,

Dom.

AdamGundry
02-01-2004, 04:50 AM
Ok, here goes...

1. I'm not sure.

2. It's probably a good solution.

3. The reason is that Mac, Windows, UNIX and the other operating systems all use different codes for carriage returns. When you transfer a file from one to another in binary mode this problem may occur.

4. SmartFTP is probably auto-detecting the file as "binary". You need to set it to use ASCII. To do this, go to Tools => Settings => ASCII/Binary and add the extension you use for the files to the list of ASCII file extensions.

5. Yes, it could.

6. It depends if your desktop machine and server use the same OS or not.

7. ASCII (see 4)

Hope this helps

Adam