9. Perl Scripting

Although Perl might have started as a simple scripting language, it has grown into a robust language designed to tackle many different coding situations. There is a great deal to learn about Perl scripting (as well as the other programming languages discussed in this book), so don’t expect to become an expert overnight.

This chapter’s focus is to give you a firm understanding of how to write basic Perl scripts as well as provide an understanding of some of Perl’s more advanced features.

Basics of Perl Scripting

Perl is an unstructured language, which means white space within the program is typically ignored. For example, the following code prints “hi” to the screen:

print "hi\n";

This could also be written as follows:1

Get Linux for Developers: Jumpstart Your Linux Programming Skills 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.