September 2017
Beginner
402 pages
9h 52m
English
The before and after operators return True or False, depending on the order of operands. In Perl 6, these operators are multi-functions that exist for arguments of different types. They work well with both numerical and string data.
Let's consider these examples where comparing strings and numbers gives opposite results:
say 10 before 2; # Falsesay 10 after 2; # Truesay "10" before "2"; # Truesay "10" after "2"; # False
Unlike the general comparison cmp operators, the ordering operators before and after return a Boolean value.
Read now
Unlock full access