Chapter 26. Perl and Python
Secrets in This Chapter
What is Perl?
What is Python?
Chapter 25, "Shell Scripts," showed a basic way of using automated programs in Ubuntu using scripts containing command-line commands. Unfortunately, writing shell script programs to manipulate large amounts of data using shell commands can be somewhat tedious. The Ubuntu environment provides two other popular scripting languages that are better suited for working with data. This chapter looks at both the Perl and Python languages available in Ubuntu, and demonstrates how to use them to help manage data.
What Is Perl?
Larry Wall wrote the Practical Extraction and Report Language (Perl) is an interpreted scripting language to augment standard shell languages. An interpreted scripting language is a set of commands that are interpreted by a program rather than directly by the operating system. As you can probably guess from its name, the basic intent for Perl was to help manipulate data to produce reports in a way that was simpler and more elegant than what's available in shell scripts.
Perl was modeled after several different programming languages, combining features from shell scripting, the C programming language, and even the Basic programming language to create a versatile programming language that's useful for UNIX system administrators. A motto commonly found in Perl circles is "there is more than one way to do it" (abbreviated TIMTOWTDI, and often called tim toady). Perl has so ...