Perl Tutorial (original) (raw)

This Perl tutorial teaches you Perl programming language from the scratch with practical examples.

If you’re new to Perl, this tutorial is a good start.

If you’re familiar with Perl and want to review your Perl knowledge, you’ll find some new features of the Perl language, which have been released in recent versions. This Perl tutorial is updated to version 5.24.

Powerful, stable, portable, and mature, Perl is one of the most feature-rich programming languages with over three decades of development.

Perl is portable and cross-platform. Currently, Perl can run on over 100 platforms.

Perl is good for both mission-critical large-scale projects and rapid prototyping.

Section 2. Basic Perl Tutorial

In this section, you’ll learn about Perl fundamentals including basic syntax, variables, operators

Section 3. Perl Data Structures

In this section, you’ll learn about three important data structures in Perl including list, array, and hash.

Section 4. Flow Control

In this section, you’ll learn how to use Perl control flow statements including if/elsif/else, for/foreach, while/do while, until/do until, next,last statements. In addition, you’ll learn how to use a relatively new statement in Perl called given/when statement, which is similar to the switch case statement in C.

Section 6. Perl References

Perl’s references are simple but very powerful. In this section, you’ll learn how to create array references, hash references, anonymous references, and other kinds of references. You’ll also learn how to use Perl references effectively in your programs.

Section 7. Subroutines

A large Perl program is divided into reusable units of code which are known as functions or subroutines. In this section, you’ll learn how to define subroutines, how to pass parameters to the subroutine by references and values, and how to pass an array reference to subroutines.

Section 8. Packages and modules

This section helps you understand packages and namespaces. And you’ll learn how to define a new module in Perl.

Section 9. File I/O

In this section, you’ll learn how to deal with File I/O such as opening a file, reading from a file, and writing to file using file handles. You’ll also learn useful file handling techniques using the diamond operator (<>).

Section 10. Perl Databases

In this section, you’ll learn how to interact with databases using the Perl DBI module.

Section 11. Object-Oriented Programming

This section helps you understand the object and the rules of Perl’s object-oriented system. In addition, you’ll learn how to define a class and reuse it in across programs.

Section 12. Advanced Perl tutorial

Feedback

Found a typo or mistake ❌, please report ? it to via the ? feedback form