leg tells if is the two strings are equal or the left operand is less or greater than the second one. Its behaviour is similar to what <=> does for numbers or what the cmp built-in operator does in Perl 5. Like the cmp in Perl 6, the leg operator returns a value of the Order type.
say "a" leg "b";ย ย ย ย ย ย ย # Less say "abc" leg "b";ย ย ย ย ย # Less say "bc" leg "b";ย ย ย ย ย ย # More say "abc" leg "ABC".lc; # Same
Before the operation, the operands are converted to strings if necessary.
say 42 leg "+42"; # More say 42 leg "42";ย # Same