[thelist] perl scripts causing server error

Means, Eric D eric.d.means at boeing.com
Tue Apr 16 17:48:10 CDT 2002


> > Did you edit the script(s) in a Windows (or Mac) editor and then copy
them
> > or upload them to the server
> > (which would imply incorrect line-termination characters)?
> Yes ! Is this really the problem ? Are cgi scripts that sensitive ?
> If so, a) how do I get the existing scripts to work, b) what text editor
> should I use to create perl scripts ?

Yes, they're really this sensitive.  In effect, if you have the "wrong" line
term characters in there, the script may appear -- to the *nix server -- as
one long line.  Or else you can get odd extra characters in there (if you do
a 'cat hi.pl' you may spot them as ^M or similar).

Actually, the output of 'cat hi.pl' might be useful.  If it comes out
looking exactly as you expect, then line term chars are not your problem.
You might also try 'perl -c hi.pl' to check and see if the script is even
compiling correctly.

In the mean time, if you use FTP to upload the scripts, make sure you are in
ASCII mode (in a text-mode FTP client, just type ASCII and hit enter, in a
graphical client there should be a button or setting somewhere) before
uploading, as that will automatically convert the line endings for you.

If you're using some other method, you can edit the files in a UNIX-friendly
editor (one which will save with the proper line term chars).  The one I use
(sadly non-free) is UltraEdit, which will allow you to freely convert back
and forth between Windows and Unix-style lines.



More information about the thelist mailing list