in reply to Use function as a regex

my @results = $str =~ /@{[ Re::re() ]}/g;

Replies are listed 'Best First'.
Re^2: Use function as a regex
by stevieb (Canon) on Feb 15, 2018 at 16:36 UTC

    Heh, that's quite slick, thanks! :)

    Might I ask where you found that tidbit? I swear I read the docs, so I must have overlooked that somewhere. I'd like to get an understanding of how and why that works properly.

      I don't think you'll find it as is in the doc. It's a side effect of the "@{ REF }" interpolation where REF can actually be an arbitrary expression, so it can be an anonymous array ref that only contains the one element you want. It's known as a secret operator.