From the course: Perl 5 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

About Perl's operators

About Perl's operators - Perl Tutorial

From the course: Perl 5 Essential Training

Start my 1-month free trial

About Perl's operators

- [Voiceover] Perl provides a very rich set of operators for many different purposes. Before we get in to the details, let's consider what an operator is and how it works. An operator takes operands and returns a value. For example, here's a very simple line of code. It contains two operators. The addition operator takes two operands and returns the sum of the operands. The assignment operator takes two operands and copies the value of the right-hand side to the variable on the left-hand side. In Perl, most operators determine the operation that is performed without concern for the type of the operands. For example, in this expression the addition operator adds two numbers. Perl will first try to convert the scaler variables to numeric values and if it is unable to do this, it will throw an error. This means that Perl must have different versions of some operators for numeric or string context. In this case the double equal operator compares two numeric values for equality while the…

Contents