Chapter 3. Perl Scripts

Image

Now it is time to write a Perl script and execute it. By the time you have finished this chapter, you should understand each of the following lines (each line is an entity unto itself):

#!/usr/bin/perl# This statement should print the sum of three numbers$n = localtime;  print "$n\n";perl -c myscript(Might be a runaway multi-line "" string...Argument "6dogs" isn't numeric in addition (+) ...

Before we get started, please take note that each line of code, in most of the examples throughout this book, is numbered. The output and explanations are also numbered to match the numbers in the code. ...

Get Perl by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.