Introduction to Operators

Let's get acquainted with Perl operators in this lesson.

What are operators?

An operator is something that takes one or more values (or expressions) and yields another value, so that the construction itself becomes an expression. For instance, when you add two numbers, 2 and 5, it yields 7. The expression looks like 2+5=7.

Types of operators

There are multiple types of operators for various purposes, such as:

  • Arithmetic operators
  • Relational operators
  • Logical operators
  • Assignment operators

The following figure illustrates the various kinds of operators in Perl:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy