Synopsis 05 mentions that Perl 6 doesn\'t interpolate variables into a regex, but you can associate an external variable with a pattern. The docs don\'t mention this feature
As an alternative to using a closure, you can of course build the regex via EVAL
.
Besides these two arguably subpar solutions, I'm drawing a blank as well. Note that you can do more complex interpolations via the <{...}>
syntax, eg
/ <{ BEGIN compute-string-once-at-compile-time }> /
but I don't see how that can be used to solve the problem...