Q&A

Q1:These things that Perl runs, are they called Perl scripts or Perl programs?
A1: The name really doesn't matter. Traditionally, programs are compiled into machine code and stored that way, and the machine code can be run many times. On the other hand, scripts are fed to an external program that translates them into actions every time they're run. Larry Wall, creator of Perl, has said that a "script is what you give an actor, a program is what you give an audience." Take that any way you'd like. For the remainder of this book, I'll call them Perl programs, and if you learn well, you can then be known as a Perl programmer.
Q2:Do I have to type the listings from this book? Some of them are pretty long.
A2: All the program listings and examples from this book, as well as any data files needed by the programs, are on the accompanying CD-ROM.
Q3:In the "Running the Program" section, you hinted at an easier way to run Perl programs under UNIX. How?
A3: First, you must make sure that the #! line of the program is correct, and that the pathname there really points to a perl interpreter; /usr/bin/perl is the usual place for it, or /usr/local/bin/perl on some machines. Next, you must make the program executable by using the chmod command. For the hello program, the UNIX shell command would be chmod 755 hello. After that's done, you can run the Perl program by typing hello or ./hello. Hint: Don't ever name your program "test" under UNIX. The UNIX shells have a command called test, and you'll be very frustrated when the wrong one runs. See your shell's documentation for other names you should avoid.

Also, if you use the listings on the CD-ROM, you will need to change the #! line to match the location of Perl on your system, or you will have to run your programs from the command-prompt by typing perl programname.

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

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