Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Perl Logical Operators
There are following logical operators supported by Perl language. Assume variable $a holds true and variable $b holds false then −
| Sr.No. | Operator & Description |
|---|---|
| 1 |
and Called Logical AND operator. If both the operands are true then the condition becomes true. Example− ($a and $b) is false. |
| 2 |
&& C-style Logical AND Operator copies a bit to the result if it exists in both operands Example− ($a && $b) is false. |
| 3 |
or Called Logical OR Operator. If any of the two operands are non zero then condition becomes true. Example− ($a or $b) is true. |
| 4 |
|| C-style Logical OR Operator copies a bit if it exists in either operand.p> Example− ($a || $b) is true. |
| 5 |
not Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false. Example− not($a and $b) is true. |
Quote-like Operators
There are following quote-like operators supported by Perl language. In the following table, a {} represents any pair of delimiters you choose.
| Sr.No. | Operator & Description |
|---|---|
| 1 |
q{ } Encloses a string with-in single quotes Example− q{abcd} gives 'abcd' |
| 2 |
qq{ } Encloses a string with-in double quotes Example− qq{abcd} gives "abcd" |
| 3 |
qx{ } Encloses a string with-in invert quotes Example− qx{abcd} gives `abcd` |
Advertisements
