Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server perl interpreter

Status
Not open for further replies.

AtoMick-u235

Programmer
Jan 29, 2022
1
GB
I am having problems running perl scripts on my website

1) does #!/usr/bin/perl already exist on the web server

2) Do i need a /usr/bin/perl directory path on the server that points to a perl binary, if so what binary is needed
 
For the she-bang line of a script ([tt]#![/tt]), the file listed, in this case "[tt]/usr/bin/perl[/tt]" is the perl executable. It must be there for the script to work. If your perl executable is in a different location, that line must still point to it.

If you do have 'perl' on your machine, type '[tt]which perl[/tt]' and it should show you where it's located. Or, that will let you know that it may not be installed or set up for you to run it.

The output of the command '[tt]which perl[/tt]' will tell you what needs to be in that first line (assuming it returns something).
 
Hi

Unsure whether being posted in the IoT forum changes the problem, this is generic web server answer.

SamBones' answer is generally correct, but keep in mind that some servers are able to handle certain file types internally, usually through dedicated modules. For example with Apache you can use mod_perl to execute Perl scripts. In that case the [tt]AddHandler[/tt] directive specifies which file extensions indicate Perl scripts. Although this way the shebang is not used anymore, programmers may still prefer to specify one to make sure their editor will use the right syntax highlighting.


Feherke.
feherke.github.io
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top