Author |
Message |
domuk
WebHelper
Joined: 15 Jan 2004
Posts: 91
|
Posted:
Sat Jan 31, 2004 7:07 pm (20 years, 2 months ago) |
|
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. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat Jan 31, 2004 7:51 pm (20 years, 2 months ago) |
|
The problem is simple: Notepad does not support Unix line breaks. You'll have to choose another text editor - I personally use Context from fixedsys.com, however there are a lot of other ones out there. |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sat Jan 31, 2004 9:09 pm (20 years, 2 months ago) |
|
if you want a simple one that comes with windows, wordpad will read them correctly |
________________________________ It's turtles all the way down... |
|
|
|
domuk
WebHelper
Joined: 15 Jan 2004
Posts: 91
|
Posted:
Sat Jan 31, 2004 11:00 pm (20 years, 2 months ago) |
|
Thanks,
Can you please explain why this is the case?
What format do i have to save them in?
Why will notepad not do it?
Is the same for HTML?
Sorry, i just want to know,
Dom... |
|
|
|
|
domuk
WebHelper
Joined: 15 Jan 2004
Posts: 91
|
Posted:
Sat Jan 31, 2004 11:06 pm (20 years, 2 months ago) |
|
will scripts still work in this format? |
|
|
|
|
SfCommand
Senior WebHelper
Joined: 10 Nov 2002
Posts: 143
Location: UK
|
Posted:
Sat Jan 31, 2004 11:41 pm (20 years, 2 months ago) |
|
I use UltraEdit (www.ultraedit.com)
If you use notepad to create your files, then you may run into troubles as it, to be honest, is a load of ****, and ins only capable of adding windows end of line chars.
Some scripts on *nix servers may choke if they have windows EOF chars instead of *nix ones.
If you get a decent editor, then you can save files in UNIX format, which will use unix EOF chars, which will be fine |
________________________________ Miguel
http://community.34sp.com
http://www.miguel.me.uk | http://www.sfcommand.co.uk | http://www.ssdg.org.uk |
|
|
|
domuk
WebHelper
Joined: 15 Jan 2004
Posts: 91
|
Posted:
Sun Feb 01, 2004 8:42 am (20 years, 2 months ago) |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Feb 01, 2004 8:46 am (20 years, 2 months ago) |
|
SfCommand wrote: | I use UltraEdit (www.ultraedit.com)
If you use notepad to create your files, then you may run into troubles as it, to be honest, is a load of ****, and ins only capable of adding windows end of line chars.
Some scripts on *nix servers may choke if they have windows EOF chars instead of *nix ones.
If you get a decent editor, then you can save files in UNIX format, which will use unix EOF chars, which will be fine |
Basically, PHP and HTML files are OK with Windows line breaks. However Perl scripts will not work if you use Windows line breaks with them. |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sun Feb 01, 2004 1:39 pm (20 years, 2 months ago) |
|
for those with shell access, you can use the utilities dos2unix and unix2dos to convert files to and from unix format |
________________________________ It's turtles all the way down... |
|
|
|
SfCommand
Senior WebHelper
Joined: 10 Nov 2002
Posts: 143
Location: UK
|
Posted:
Mon Feb 02, 2004 7:24 pm (20 years, 2 months ago) |
|
|
|
|
|