On 2022-06-24 3:17 p.m., Paul "LeoNerd" Evans wrote: > my $n = ...; > > match($n : ==) { > case(1) { say "It's one" } > case(2) { say "It's two" } > case(3) { say "It's three" } > case(4), case(5) > { say "It's four or five" } > default { say "It's something else" } > } I consider that the best part of this is you specify inline the exact comparison operator or sub to use, the "==" in this case, meaning that the semantics of the matching is completely explicit, rather than some implicit complicated logic. This should be generic and configurable in the same way map/grep/sort etc are. -- Darren DuncanThread Previous | Thread Next