Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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.


Comment on Re: Perl CGI gives HTTP error 500

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://454741]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2014-07-13 02:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (245 votes), past polls