On 4/27/01 7:58 AM, "Nelson Goforth" <[EMAIL PROTECTED]> wrote:
> 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.
>
The ironic thing is that your aside to OS X users is probably the solution
to your problem. Try checking the line endings of the simple script above.
I'm willing to bet that it has Mac line endings. With Mac line endings, the
shebang line runs together with the print statement and nothing happens.
Remove the shebang and while the line endings are still Mac, there's only a
single statement and it executes. (at least that's what a couple of tests
showed on my machine)
Todd
--
Todd Richmond http://cellwall.stanford.edu/todd
Carnegie Institution email: [EMAIL PROTECTED]
Department of Plant Biology fax: 1-650-325-6857
260 Panama Street phone: 1-650-325-1521 x431
Stanford, CA 94305