BONUS CHAPTER 46
Using Perl
IN THIS CHAPTER
Using Perl with Linux
Perl Variables and Data Structures
Perl Operators
Conditional Statements: if/else and unless
Looping
Regular Expressions
Access to the Shell
Modules and CPAN
Code Examples
References
Perl (whose name comes from the Practical Extraction and Report
Language or the Pathologically Eclectic Rubbish Lister, depending on who
you speak to) is a powerful scripting tool that enables you to manage files,
create reports, edit text, and perform many other tasks. Perl is included with
and installed in Ubuntu by default and could be considered an integral part of
the distribution because Ubuntu depends on Perl for many types of software
services, logging activities, and software tools.
Perl is not the easiest of programming languages to learn because it is
designed for flexibility. This chapter shows how to create and use Perl scripts
on your system. You learn what a Perl program looks like, how the language
is structured, and where you can find modules of prewritten code to help you
write your own Perl scripts. This chapter also includes several examples of
Perl used to perform a few common functions on a computer system.