質問

I installed apache and perl a few days ago and have been successful in running a few scripts, but I have not been able to get a single script to run after putting the "use strict;" line in. All I see upon adding that line is a very generic "Internal Server Error" with ZERO unique information.

Here's a script that does gives the error:

#!/usr/bin/perl

use strict;

print "Content-Type: text/html", "\n\n";

print "Hello World";

Cannot find anyone else having this problem, really puzzling me. Could it be some setting in my installation of perl or something?

役に立ちましたか?

解決

Always check the error log in situations like this. Let it tell you what's wrong.

There are at least three likely possibilities:

  1. The script is not executable, and so will not run. (unix specific)
  2. #!/usr/bin/perl does not exist and so can't be executed.
  3. Your @INC is messed up some how, and so strict cannot be found.

Your error log should be able to say if it is one of these fairly quickly.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top