Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Perl provides two sets of comparison operators; one set for working with numbers, and one set for working with strings.

Numbers

Strings

==

eq

!=

ne

<

lt

<=

le

>

gt

>=

ge

<=>

cmp

Do not use the number comparison operators on non-numeric strings. Likewise, do not use the string comparison operators on numbers.

...