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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Headers?

Status
Not open for further replies.

morpheos

Programmer
Dec 10, 2000
23
US
In most CGI scripts I see this header

what does it means?

#!/usr/local/bin/perl
I understand that it says where my perl interpreter is?
but if it means that how do I know where the perl interpreter is in one paid site like
 
Ask your webmaster.

if you can telnet in then try
whereis perl
 
Hi morpheos,

All web hotels doesn´t let you have cgi scripts on their server, for security reasons.

I recomend you to write to your hotel: and ask them if they support cgi scripts and if the do, were their perl interpreater is.

I hope this answer is clear and that I didn´t missunderstand your question.

/Fumac
 
The header is also for Unix/Linux systems. If the server that you are hosting with is under Windows, or NT, the "shebang" line, as it is called in the Perl community, is not necessary.

And if you are not on a Unix/Linux system, you can't use the whereis perl command. You would have to use the find command via DOS or search from the Start menu..

Hope this helps,

-Vic vic cherubini
malice365@hotmail.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
Geocities does not support custom scripts. I am a geocities user for some of my web tasks. does support custom cgi scripts and you can link to them from you geocities site.


The header function will also print to the web browser as set of commands so the browser what kind of data it is recieving. It is required for most cgi scripts to run propery. You can simulate that contents of the header in other ways as is much of things in perl but this is the easiest.
 
Ask your web system engineer or if you have telnet access
type in the shell

whereis perl

and it wil return more than one path (normaly)

usualy.

#!usr/bin/perl or #!/usr/local/bin/perl

Good luck
 
what that line DOES is allow you to execute a perl program directly rather than via the perl interpreter. What that means is you can simply execute myprog.pl rather than saying perl myprog.pl. It can get a lot more complicated than that, but that's the gist of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top