in reply to Re^2: Use function as a regex
in thread Use function as a regex

I don't see any connexion between :lvalue and /g. $str =~ ${re()} isn't a global search but the output of qr is already a reference so /${re()}/g works, as pointed out by salva.

Replies are listed 'Best First'.
Re^4: Use function as a regex
by Anonymous Monk on Feb 15, 2018 at 18:29 UTC

    Embarrasing. I read it exactly backwards. Something like while (str() =~ /(.)/g) can be made to work by using sub str :lvalue { state $x = "abcd" }.

    Sorry about the noise.