Questions about this topic? Sign up to ask in the talk tab.
Difference between revisions of "Perl/Basics/Boolean Logic/Operators/Mathematical"
From NetSec
Chantal21I (Talk | contribs) |
Chantal21I (Talk | contribs) m (moved Perl/Basics/Boolean Logic/Operators/Mathematic to Perl/Basics/Boolean Logic/Operators/Mathematical) |
(One intermediate revision by one other user not shown) | |
(No difference)
|
Latest revision as of 01:12, 19 July 2012
- =
The = operator assigns a value to a variable.
- ==
The == operator is used to test if a variable is equal to a value or another variable.
- !
The ! operator means "not". It applies to = and any variable. For example, "if (!$scalar)" is used to determine if the $scalar variable is null, zero, or undefined. When used before a = operator, this becomes "not equal to".
- eq
Sometimes because variables may not be a string or integer, the eq operator is used to determine if the two are equal.
The following operators are used for greater than, less than, and greater than or equal to, less than or equal to, etc; similar to other languages:
- >
- gt
- <
- lt
- >=
- gte
- <=
- lte