Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Line endings

by jhourcle (Prior)
on Jul 12, 2004 at 02:17 UTC ( #373534=note: print w/ replies, xml ) Need Help??


in reply to FTPing

The issue is with line endings, but most likely not why you think.

In the first line of the file, you'll have:

#!/usr/bin/perl

or the equivalent.

If you transfer between a windows PC and a UNIX box, you end up with:

#!/usr/bin/perl^M

So, when you go to execute the script, it looks for 'perl^M' to execute, which it can't find. When you're dealing with CGIs, this can be a real problem to debug, as you'll get 'file not found' type error message which confuses people.

Just to be safe, I recommend using the shebang line of:

#!/usr/bin/perl --

Typically, you can get away with bad line endings for most scripts this way, but I'm guessing '<<EOF' type declarations would be a problem, as would pod.


Comment on Line endings

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-07-04 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls