
27-09-2010
|
| Member | | Join Date: Jul 2010
Posts: 72
| |
| Invocation of the Perl
The following tip can be useful while doing an Invocation of the Perl. Since each script must be interpreted by the program 'perl', and given that the scripts are just simple text file, must begin with the characters #! followed with the full path to the perl binary on your system, typically: Code: # / Usr / bin / perl
or
# / Usr / local / bin / perl (To locate where it resides in your system, the Perl interpreter, type 'which perl' in a terminal even if, usually, the interpreter is installed in / usr / bin, but you can never know for sure). This, once the file is made executable (chmod 755 name_script.pl), is so that when the script runs, the kernel reads the first line and go find the interpreter, who then will the interpretation of rest of the code.
An alternative method to launch a perl script is to call 'perl' with the script name as argument: perl script.pl |