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

easy perl problem

Status
Not open for further replies.

Norrin

Programmer
Apr 21, 2000
2
GB
hello,<br><br>I am just new to perl and would apricate an answer to a simple question.<br><br>in looking at perl example code, some programs have the following two line of code at the top of the program.<br><br>#!/usr/bin/perl<br># change the above code to whereever your perl interpreter is.<br><br>Fine, I assume you simply enter the pathway for my intepreter in the top line, but in doing that how do you make it work?<br><br>This is in connection with cgi and the creation of cookies.&nbsp;&nbsp;I think it's meant to be run inside a web browser, but it doesn't work, I'm I missing a reference.<br><br>Please help urgently<br><br>Thank you<br><br>
 
The #!/usr/bin/perl string implies that you are on a UNIX OS.&nbsp;&nbsp;In that context...a few <br>thoughts....<br><br>Once you have fixed the top line of the program, try <br>perl -c yourProgramName.cgi &lt;return&gt;<br><br>That will do a syntax check on your code and barf on you if it has problems.&nbsp;&nbsp;If it does not complain, then your syntax is OK.<br><br>Make sure the execute bit(s) are set so the web daemon can run the code.&nbsp;&nbsp;If you don't understand this, ask and I will elaborate.<br><br>Make sure your code is in a directory which your web server recognizes as legal for <br>executable code. Usually,........./httpd/cgi-bin/someSubDir/&nbsp;&nbsp;&nbsp;or something like that downstream on the http/cgi-bin path.<br><br>Additionally, this is not meant to be insulting ( I don't know everything either) but, the nature of your question indicates a fairly shallow knowledge of PERL and CGI.&nbsp;&nbsp;Note, those are two completely separate topics.&nbsp;&nbsp;Try SAMs &quot;teach yourself CGI Programming with Perl 5 in a week&quot;.&nbsp;&nbsp;It is fairly straight forward with enough perl and enough CGI to get you on your feet.&nbsp;&nbsp;Be aware that playing around in CGI with an insufficient understanding of the security issues can get you&nbsp;&nbsp;in a bad way.&nbsp;&nbsp;Security is an issue.
 
WINDOWS INFO<br>The #!/usr/bin/perl line on windows can be tricky some web servers need to have it look like that and the folder actually exist on the web ex #!/usr/bin/per/&nbsp;&nbsp;the folder <A HREF=" TARGET="_new"> would have to exist.&nbsp;&nbsp;on the apache web server the first line has to look like this #!c:/perl/bin/perl.exe&nbsp;&nbsp;&nbsp;not that that is an actuall file path.&nbsp;&nbsp;and that they are slashes(/) and not back slashes(\).&nbsp;&nbsp;hope mine or goBoating's reply helps <p>Karl Pietri<br><a href=mailto:lordhuh.pota.to>lordhuh.pota.to</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top