Appendix B. Perl Summary

This appendix summarizes those parts of the Perl programming language that will be most useful to you as you read this book. It is not a comprehensive summary of the Perl language. Remember that Perl is designed so that you don't need to know everything in order to use it. Source material for this appendix came from Programming Perl, Third Edition (O'Reilly & Associates).

Command Interpretation

The Perl programs in this book start with the line (with or without the -w):

#!/usr/bin/perl -w

On Unix (or Linux) systems, the first line of a file can include the name of a program and some flags, which are optional. The line must start with #!, followed by the full pathname of the program (in our case, the Perl interpreter), followed optionally by a single group of one or more flags.

If the Perl program file is called myprogram, and has executable permissions, you can type myprogram (or possibly ./myprogram, or the full or relative pathname for the program) to start the program running.

The Unix operating system starts the program specified in the command interpretation line and gives it as input the rest of the file after the first line. So, in this case, it starts the Perl interpreter and gives it the program in the file to run.

This is just a shortcut for typing:

/usr/bin/perl -w myprogram

at the command line.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset