Perl Operator TypesPerl operators provide values to their operands like numeric, Boolean or string, etc. To choose an appropriate operator, you need to know the value of operands. We'll discuss following type of operators:
Perl Numeric operatorsNumeric operators are the standard arithmetic operators like addition (+), subtraction (), multiplication (*), division (/) and modulo (%), etc. Perl String operatorsString operators are positive and negative regular expression with repetition (=~ and !~) and concatenation ( .). String Concatenation operator output: Hello this is JavaTpoint. String Repetition operator output: Thank You Thank You Thank You. Here, note that on the right of 'x' it must be an integer. There should be space on either side of the 'x' operator. For example, Perl Logical operatorsLogical operators give a Boolean value to their operands. They are (&&,  and or). && > In && operator, if $a is 0, then value of $a && $b must be false irrespective of the value of $b. So perl does not bother to check $b value. This is called shortcircuit evaluation.  > In  operator, if $a is nonzero, then value of $a && $b must be true irrespective of the value of $b. So perl does not bother to check $b value. Example: Output: 0 12 Perl Bitwise operatorsBitwise operators treat their operands numerically at bit level. These are (<<, >>, &, , ^, <<=, >>=, &=, =, ^=). Every number will be denoted in terms of 0s and 1s. Initially integers will be converted into binary bit and result will be evaluated. Final result will be displayed in the integer form. Example: Output: 127 96 31 15 Perl Special operatorsThe autoincrement (++) operator is a special operator that increments the numeric character itself by 1. Example: Output: 10 Y Perl Comparison operatorsThe comparison operator compares the values of its operands. These are ( ==, <, <=, >, >=, <=>, !=). Example: Output: Enter your salary: 15000 You are not earning well Perl Assignment operatorsThe assignment operator assigns a value to a variable. These are (=, +=, =, *=, /=, =, &=, %=) Example: Output: 40 30 30 10
Next TopicPerl ifelse
