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.

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux