Correct Path To Perl

liunx

Guest
Hello;<br /><br />I want to be sure on writing the perl address, I did ask this before and I got <br />the right answer, now in the code page of perl that I have, there is already a perl address, <br />here it is:<br /><!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->#!/usr/bin/perl<!--sizec--></span><!--/sizec--><br /><br />I have got the perl address before and it is:<br /><!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->/usr/bin/perl<!--sizec--></span><!--/sizec--><br /><br /> there are two signs in the beginning<br />which make me confused:<br /><br /><br />If you know perl, I appreciate your help,<br /><br />should I remove those signs or not?<br /><br /><br />Thank You for your help<!--content-->
The first line is the correct way to include the path to perl in your scripts.<br /><br />#!/usr/bin/perl<br /><br />The #! is called a shebang. This line instructs the operating system the Perl script is being ran in where the executable for Perl and all of its associated files are located. This line is commonly only required in Linux and UNIX variants, users running Perl in Microsoft Windows do not need this line.<!--content-->
OK, I got it,<br />Thanks a lot<!--content-->
Hi,<br /><br />I'll add that Bruce is right on and this difference between Linux and Widows will often create havoc in testing enviroments if you are testing in a Windows environment and running production on Linux. Some Perl versions of Windows will not run with the #! in the beginning.<br /><br />Thus a windows programmer can get very frustrated when he has tested his code, uploaded it, and then it doesn't work just because of a simple #!.<br /><br />Not fun! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /><br /><br />Keep your eye out! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><br /><br />Take care,<!--content-->
 
Back
Top