How do I compare two strings in Perl? -
How do I compare two strings in Perl?
I'm learning Perl, I had this basic question seen on stack overflow and I did not get any good answer, so I thought I would ask.
lt , gt , eq , ne , and cmp as appropriate for the string Code> use comparison:
binary
eqreturn is correct if the left argument stringing is equal to the right logic.Binary
nereturns true if the left argument stringing is not equal to the right logic.The binary
cmpdepends on return -1, 0 or 1, that the left argument is less than stringwise, or more than the exact or true argument.Binary
~~does a smartmatch between its arguments. ...
lt,take,ge,gtandcmp If any legacy uses the locale (but 'use the specified order (sort order) specified by the locale. See . Do not mix it with Unicode, only with legacy binary encoding. Provide more powerful solutions for standard and module collation problems.) is in effect, then
Comments
Post a Comment