>For quite some time I was happily using ActivePerl & PWS, but recently >reinstalled a fresh windows, and hence came to reinstalling ActivePerl >However, this time I decided to use Apache instead of PWS. At first I was >happy, it all seemed to work. However, I have perl scripts on various >different servers, and so want to setup apache to ignore the #! [my scripts >don't all go on server with the same perl path] Unfortunately, this time >around I could not get it to work. At first I thought it was Apache but I've >traced it back to ActivePerl. If I load up command prompt and do say:
>perl test.pl >where test.pl is: > #!/usr/bin/ > print qq|hello|; >It returns the error: "Can't exec /usr/bin at test.pl line 1.". However, if >I alter the sheband line to #!c:/net/perl/bin/perl.exe or remove it >altogther then it works fine! Can anyone tell me why it is doing this and >how I sort it out? I'm guessing that perl is set to some sort of >debug/warning mode where it checks the validitity of the shebang line, but I >can't find any reference to such anywhere. The shebang identifies the perl interpreter. The perl interpreter isn't /usr/bin. In a UNIX system the perl interpreter might very well be IN /usr/bin, so the shebang would be #!/usr/bin/perl I would guess that your interpreter is c:/net/perl/bin/perl.exe and that your environment is clever enough to say "If he doesn't tell me otherwise I will assume the perl interpreter is in the well-known place where the interpreter was installed." On a tangentially related note I learned (yesterday at about noon) that I would have to have our product ready for a customer demo today at noon. And that the documentation I'd been doing would have to wait. That afternoon I ran the product through its paces and got cryptic "Can't open file" messages in the error log. Turns out that the documentation template I was using had been done on Windows while the program resided on a Linux box. To the normal editor and print out it looked like this: #!/usr/local/bin/perl ##### BLAH BLAH BLAH ##### REALLY OBSCURE COMMENT ##### BLAH BLAH BLAH It was only when I looked at it with VIM some hours later that the error jumped out: #!/usr/local/bin/perl^M ^M ##### BLAH BLAH BLAH ^M on the nonworking ones and #!/usr/local/bin/perl ^M ##### BLAh BLAH BLAH on the working ones. Hope this saves one of you some gray hairs some day. Todd _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
