Constructing Perl Scripts

In yesterday's lesson, I explained a little bit about what a Perl script actually looks like, and we looked at both a Perl one-liner and a Perl script. Let's pause in this discussion about data to go into a little more detail about that, and about the general ground rules for combining data, variables, and other operations into Perl statements, and Perl statements into Perl scripts.

Perl scripts, whether they are executed as one-liners or in separate files, consist of one or more statements, usually executed in order. Perl statements can be simple statements, such as variable assignment or the expressions you'll learn about later today, or they can be more complex statements like conditionals and loops, which you'll ...

Get Sams Teach Yourself Perl in 21 Days, Second Edition 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.