If you find that the
#!-line in a Perl script does not seem to take effect (which seems to be the case here), then it's likely because the scripts are being invoked with an explicit interpreter, as in
In this case, the
#!-line would be completely ignored, and the actual
perl binary used would be the first one found in
If you can change the way that the scripts are being invoked, then you would ideally change that to drop the explicit
perl command. This would make the
#!-lines in the scripts take effect (assuming the scripts are executable).
Alternatively, you would arrange for the
$PATH variable so that the first
perl binary found is the one that you know that you want to use. For example, you may want to set
for the environment in which the CGI script executes. This would solve the issue unless the invocation is with
usr/bin/perl explicitly. Since there is no indication in the question what web server software or framework is in use, or how it's configured to run Perl scripts, that's all I can say.