in reply to Re^2: Bad File Descriptor
in thread Bad File Descriptor

Thanks for the info. I didn't know that about Apache quirk on Windows. I do most of my work on Windows (but all cgi stuff on Unix). I put /usr/bin/perl in the Shebang line so that I can test on windows and can transfer the program to the Unix box.

This is a weird one! So you have two programs with same Shebang line, in same directory, same permissions and one works and the other doesn't. This is a weird thought, but maybe these 2 shebang lines just look the same, but really aren't? There could be a non-printing control character or maybe the line endings are different and Apache cares about that? Something has to be different and we've ruled a lot out. Unix ends lines with a simple LF while Windows uses a CR, LF (carriage return, line feed). That difference would be invisible to you in the text editor. Compare the binary of the first couple of lines and see if you can discern any difference at all between the "works" and "doesn't work" files. This shouldn't matter (Perl and in most cases Windows doesn't care), but maybe somehow Apaches does care? I know this is a long shot, but geez there has to be something different and I'm running out of ideas as to what that could be.

update: Yes as choroba points out, there could also be something "invisible" before the line starts, a BOM. A binary compare should yield a definitive answer.

Replies are listed 'Best First'.
Re^4: Bad File Descriptor
by Milti (Beadle) on Oct 03, 2016 at 16:29 UTC

    It appears that you and Choroba are correct. I cleared the top of the program and entered the Shebang line again at the very top and it worked. I also was unaware that Apache, by default, looks for the Shebang line and I have since changed the HTTPD Config file by adding "ScriptInterpreterSource Registry'. I think the problem is solved!