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
perl somescript.pl
In this case, the #!
-line would be completely ignored, and the actual perl
binary used would be the first one found in $PATH
.
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
PATH=/usr/local/cpanel/3rdparty/bin:$PATH
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.
#!
-line in the file is the interpreter it will use, assuming you don't invoke the scripts with an explicit interpreter. If you do, you can have anything in the#!
-line, and it would not matter what that path said as it would be ignored.