Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Perl CGI gives HTTP error 500

by steelrose (Scribe)
on May 06, 2005 at 17:53 UTC ( #454741=note: print w/replies, xml ) Need Help??

in reply to Perl CGI gives HTTP error 500

The reason is that Windows defines a line ending as a CR and a LF (CR/LF) and Unix defines a line ending as just an LF.

When you transfer the file from Windows to the unix box, if you open it in vi on the unix box, you'll notice that each line ends with a ^M character. This is the CR/LF.

If you don't want to mess around with your Windows editor settings, you can use the following unix command. It works without fail for me:

tr -d '\r' <inputfile> outputfile

What that does is remove the Carriage Return (CR) character.

If you give a man a fish he will eat for a day.
If you teach a man to fish he will buy an ugly hat.
If you talk about fish to a starving man, you're a consultant.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://454741]
[smarthacker67]: hi

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2018-05-26 12:09 GMT
Find Nodes?
    Voting Booth?