my @search_keys = <bb cc dd>; say "bb" eq any(@search_keys);
Syntax | is just sugar for calling any() function. Just like & is syntactic sugar for the all() function. They return Junction s, which you can collapse, for example. so . Of course, if you are going to use it in a conditional expression, you do not need to collapse it yourself, the Bool condition will do this for you:
say "found" if "bb" eq any(@search_keys);
See also: https://docs.perl6.org/type/Junction
source share