Horje
perl compare strings Code Example
perl compare strings
# 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 match pattern Code Example perl match pattern Code Example
perl match regex Code Example perl match regex Code Example
perl compare scalars Code Example perl compare scalars Code Example
perl hash operations Code Example perl hash operations Code Example
perl while loop Code Example perl while loop Code Example

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