Odd problem here.

I'm running Mac OS X with Apache 1.3.19

I was having difficulties with Apache server giving me errors and finally
went over and tried to run my (existing) scripts from the command line.
Nothing happened.  So I wrote a VERY simple script:

#!/usr/bin/perl

print "Hello\n";

But this script will NOT run from the command line (nor with Apache).  If I
type in 'perl -w try.pl' absolutely nothing happens, just get the command
line again.  However, if I remove the #! (shebang) line, it works just fine.

Did a "where" of course:
% where perl
/usr/bin/perl

and even copied that response line and pasted it into the script.

Now I had these scripts working properly on another machine (I had to send
it in for screen problems), so I don't think OS X or Apache are really the
issue.  But I could be wrong.  I've also posted this problem on the
cgi-list.

--

Just as an aside to OS X users.  The old Mac standard line ending is ASCII
13 (octal 015 or Carriage Return) - OS X uses the UNIX standard ASCII 10
(octal 012 or Linefeed).  Since my scripts were written on an earlier system
I had to either replace the CRs with LFs, or change the Input Record
Separator in my scripts to the LF character rather than the Mac's CR (used
$\ = "/015").  These worked fine.  Thanks to Daniel Macks for helping me
with this issue on this list.

Curiously, though, my scripts written on a Mac have worked well for several
years on a Linux server running Apache. I'm not sure whether somehow a
translation was done as I ftp'd the scripts or just what, but if so they
were translated BACK when I pulled them onto my machine.  I'm going to try
to find out, however.  Is it possible that Linux/Apache could understand
EITHER line ending?  Is that a config statement somewhere?

--

Thanks for any assistance.

Nelson

Reply via email to