More Operators
Perl has so many operators that I don't have enough space in this book to fully document them all. But for the remainder of this hour, you'll read about the most commonly used operators and functions in Perl.
1-Argument Operators
Until now, all the operators you've read about take two arguments. Division (6/3) requires a dividend (6) and a divisor (3), multiplication (5*2) requires a multiplicand (5) and a multiplier (2), and so on. Another kind of operator takes only one argument. You're probably familiar with one example of these already—the unary minus (-). The unary minus returns the value of its argument negated as a negative number:
6; # Six −6; # Negative six. −(−5); # Positive five, not negative five.
Many of Perl's operators ...
Get Sams Teach Yourself Perl in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.