Re: Problem getting cgi script to work with apache?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gordon Messmer wrote:
Knute Johnson wrote:

No it was almost twice as many lines. But I think that is where the problem is. Another fellow suggested that I try dos2unix and that makes a file exactly the same size as the VIM copied one that works. I just tried it and that has fixed my problem. I had no clue that perl was sensitive to carriage returns.

As far as I know, it's not. The problem you run in to is that the kernel *is* sensitive to CR in the shebang. If the first line of your file is:

#!/usr/bin/perl\r\n

...then the kernel will try to exec "/usr/bin/perl\r", which doesn't exist. Naturally, as a kernel issue, this affects all scripts, regardless of the interpreter used.

..which is why it's a good idea to always use:

#!/usr/bin/perl --

..as the shebang line, which won't get messed up by any combination of line endings.

Simon.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux