Horje
perl compare scalars Code Example
perl compare scalars
# Basic syntax:
|    Comparison Test    | Numeric | String |
|:---------------------:|:-------:|:------:|
| Equal                 | ==      | eq     |
| Not Equal             | !=      | ne     |
| Comparison            | <=>     | cmp    |
| Less than             | <       | lt     |
| Greater than          | >       | gt     |
| Less than or equal    | <=      | le     |
| Greater than or equal | >=      | ge     |
# Note, when comparing scalars ($), Perl uses different operators depending
#	on whether the scalars are numbers vs strings.
# Note, when comparing strings, Perl compares them character by character
#	using their ASCII values (so e.g., "B" is greater than "A" and "AAA")




14

Related
perl hash operations Code Example perl hash operations Code Example
perl while loop Code Example perl while loop Code Example
perl associative array Code Example perl associative array Code Example
perl until loop Code Example perl until loop Code Example
perl for loop Code Example perl for loop Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12