In perl, for numerical comparison, we have +/- inf as numbers that are greater/less than every other number. Are there also strings that are gt/lt any other string?
The reason I ask is that I’d like to tack one or the other on the end of a list of strings to ensure that a loop will terminate before the end of the list.
The empty string or
undefis less than every other string.There is no finite string that is greater than every other string. But if you can make certain assumptions like all of the strings in your loop are ASCII strings, you could specify a string like “\x80” (ASCII value 128) that would be greater than all of your strings.