Categories Pricing Corporate
Free Textbook

Perl for Beginners

10 Reviews
(10 ratings)
Language:  English
Perl is a popular programming language, often mentioned in job adverts. It is heavily used for system admin, and for Web development.
Download free PDF textbooks or read online. Less than 15% adverts
Business subscription free for the first 30 days, then $5.99/mo

Perl is a popular programming language, often mentioned in job adverts. It is heavily used for system admin, and for Web development. And it is fun. Compared with Perl, other languages can feel worthy but tedious.

However, few universities use Perl as a teaching language. Hence the need for a self-instruction textbook, like this one.

Beginners need to focus on the core of the language, bypassing features which are not essential in the early stages. This book does that: it covers all you need to write successful Perl programs, while shielding you from confusing inessentials.

  1. Introduction
  2. Getting started
  3. Data types
  4. Operators
    1. Number and string operators
    2. Combining operator and assignment
    3. Truth-value operators
  5. Flow of control: branches
  6. Program layout
  7. Built-in functions
  8. Flow of control: loops
  9. Reading from a file
  10. Pattern matching
    1. Matching and substitution
    2. Character classes
    3. Complement classes and indefinite repetition
    4. Capturing subpatterns
    5. Alternatives
    6. Escaping special characters
    7. Greed versus anorexia
    8. Pattern-internal back-reference
    9. Transliteration
  11. Writing to a file
    1. Reading, writing, appending
    2. Pattern-matching modifier letters
    3. Generalizing special cases
  12. Arrays
    1. Tables with numbered cells
    2. An example
    3. Assigning a list to an array
    4. Adding elements to and removing them from arrays
    5. Other operations on arrays
  13. Lists
  14. Scalar versus list context
  15. Two-dimensional tables
  16. User-defined functions
    1. Adapting Perl to our own tasks
    2. The structure of a user-defined function
    3. A second example
    4. Multi-argument functions
    5. Divide and conquer
    6. Returning a list of values
    7. “Subroutines” and “functions”
  17. Hash tables
    1. Tables indexed by strings
    2. Creating a hash
    3. Working through a hash table
    4. Advantages of hash tables
    5. Hashes versus references to hashes
  18. Formatted printing
  19. Built-in variables
  20. The debugger
  21. Beyond the introduction
  22. Endnotes
About the Author

Geoffrey Sampson

Geoffrey Sampson is a British university teacher. After studying Oriental languages and computing at the University of Cambridge and at Yale University in the USA, he spent the earlier part of his career teaching linguistics, and the later part teaching informatics, specializing in e-business and legal aspects of information technology; he directed the Sussex Centre for Advanced Software Applications, and led research projects sponsored by the UK Ministry of Defence and other agencies. Sampson has held visiting posts at British Telecom Research Labs, at the Royal Signals and Radar Establishment (now Qinetiq), and at the universities of Geneva, Cape Town, and the Witwatersrand.  After retiring from his chair at Sussex University, Sampson spent some years as a research fellow at the University of South Africa.

Sampson has published many books and academic papers. Most are about information technology or linguistics, but for instance he has also published a book of translations of 3000-year-old Chinese love poetry.